开发者

Using XmlNamespaceDictionary object, namespaceAliasToUriMap field is not visible (gives error)

import com.google.api.client.xml.XmlNamespaceDictionary;

XmlNamespaceDictionary NAMESPACE_DICTIONARY = new XmlNamespaceDictionary();

Map<String, String> map = NAMESPACE_DICTIONARY.namespaceAliasToUriMap;

gives namespaceAliasToUriMap not visible in eclipse. Why this field is n开发者_如何学Goot visible, when other function are visible?


Use getAliasToUriMap() instead. (As suggested by Eclipse as well)

This field is being encapsulated according to the documentation in the class XmlNamespaceDictionary As the implementation implies, it is protected against modification

/**
   * Returns an unmodified set of map entries for the map from namespace alias (or {@code ""} for
   * the default namespace) to namespace URI.
   *
   * @since 1.3
   */
  public synchronized Map<String, String> getAliasToUriMap() {
    return Collections.unmodifiableMap(namespaceAliasToUriMap);
  }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜