开发者

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

开发者 https://www.devze.com 2023-04-05 06:25 出处:网络
import com.google.api.client.xml.XmlNamespaceDictionary; XmlNamespaceDictionary NAMESPACE_DICTIONARY = new XmlNamespaceDictionary();
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

精彩评论

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