Package ddf.util

Class NamespaceResolver

java.lang.Object
ddf.util.NamespaceResolver
All Implemented Interfaces:
NamespaceContext

public class NamespaceResolver extends Object implements NamespaceContext
DDF namespace resolver loads all registered NamespaceMap interfaces and builds two HashMaps: one for namespace URIs to prefixes, and one for namespace prefixes to URIs. If there are multiple entries found for a single URI or prefix, the last one loaded from the OSGi Service Registry will be the one used.
Author:
Hugh Rodgers
  • Field Details

  • Constructor Details

    • NamespaceResolver

      public NamespaceResolver()
      DDF namespace resolver loads all registered NamespaceMap interfaces and builds two HashMaps: one for namespace URIs to prefixes, and one for namespace prefixes to URIs. If there are multiple entries found for a single URI or prefix, the last one loaded from the OSGi Service Registry will be the one used.
  • Method Details

    • getNamespaceURI

      public String getNamespaceURI(String prefix)
      Retrieve the namespace URI for the given namespace prefix. Prefix is retrieved from the list of namespace URIs and prefixes mapped from NamespaceMap entries in the OSGi Service Registry.
      Specified by:
      getNamespaceURI in interface NamespaceContext
      Returns:
      the namespace URI for the given namespace prefix
    • getPrefix

      public String getPrefix(String namespace)
      Retrieve the namespace prefix for the given namespace URI. URI is retrieved from the list of namespace URIs and prefixes mapped from NamespaceMap entries in the OSGi Service Registry.
      Specified by:
      getPrefix in interface NamespaceContext
      Returns:
      the namespace prefix for the given namespace URI
    • getPrefixes

      public Iterator getPrefixes(String namespace)
      Specified by:
      getPrefixes in interface NamespaceContext