alma::acs::config::validators::XmlNamespaceContextContainer Class Reference

Inheritance diagram for alma::acs::config::validators::XmlNamespaceContextContainer:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::config::validators::XmlNamespaceContextContainer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

String getNamespaceURI (String prefix)
String getPrefix (String namespaceURI)
Iterator< String > getPrefixes (String namespaceURI)
void addNamespace (String prefix, String uri)

Private Attributes

Map< String, String > prefixUriMap = new HashMap<String, String>()

Detailed Description

Support class for XPath queries which allows to bind XML namespaces to prefixes, using javax.xml.xpath.XPath#setNamespaceContext(javax.xml.namespace.NamespaceContext). This is especially needed for XPath queries on XML documents that use an (unnamed) default namespace, for which an "artificial" prefix must be defined and communicated to the XPath engine, so that the XPath expression can use that prefix in order to match the default namespace.

This class with its method addNamespace(String, String) This method serves a similar purpose as jdom's org.jdom.xpath.XPath#addNamespace(String, String) method.

Implementation note: we only keep a map to quickly go from prefix to namespace, but not the other way around. According to http://xml.apache.org/xalan-j/xpath_apis.html#namespacecontext the XPath processor in Xalan never needs the methods that return prefixes, thus their performance does not matter at the moment.

Author:
hsommer

Member Function Documentation

void alma::acs::config::validators::XmlNamespaceContextContainer::addNamespace ( String  prefix,
String  uri 
) [inline]

Adds a prefix/namespace pair.

Parameters:
prefix 
uri 

References prefixUriMap.

Referenced by alma::acs::config::validators::ConfigFileRedeemerXml::_isNotAConfigFile().

String alma::acs::config::validators::XmlNamespaceContextContainer::getNamespaceURI ( String  prefix  )  [inline]

References prefixUriMap.

String alma::acs::config::validators::XmlNamespaceContextContainer::getPrefix ( String  namespaceURI  )  [inline]
See also:
javax.xml.namespace.NamespaceContext::getPrefix(java.lang.String)

References getPrefixes(), and prefixUriMap.

Iterator<String> alma::acs::config::validators::XmlNamespaceContextContainer::getPrefixes ( String  namespaceURI  )  [inline]

References prefixUriMap.

Referenced by getPrefix().


Member Data Documentation

Map<String, String> alma::acs::config::validators::XmlNamespaceContextContainer::prefixUriMap = new HashMap<String, String>() [private]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2