Class SessionNamespaceResolver

  • All Implemented Interfaces:
    NamespaceResolver

    public class SessionNamespaceResolver
    extends java.lang.Object
    implements NamespaceResolver
    helper class that exposes the NamespaceResolver interface on a Session.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPrefix​(java.lang.String uri)
      Returns the prefix which is mapped to the given URI.
      java.lang.String getURI​(java.lang.String prefix)
      Returns the URI to which the given prefix is mapped.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SessionNamespaceResolver

        public SessionNamespaceResolver​(Session session)
        Creates a new namespace resolver based on a session
        Parameters:
        session -
    • Method Detail

      • getPrefix

        public java.lang.String getPrefix​(java.lang.String uri)
                                   throws NamespaceException
        Returns the prefix which is mapped to the given URI.
        Specified by:
        getPrefix in interface NamespaceResolver
        Parameters:
        uri - namespace URI
        Returns:
        the prefix mapped to the given URI.
        Throws:
        NamespaceException - if the URI is unknown.
      • getURI

        public java.lang.String getURI​(java.lang.String prefix)
                                throws NamespaceException
        Returns the URI to which the given prefix is mapped.
        Specified by:
        getURI in interface NamespaceResolver
        Parameters:
        prefix - namespace prefix
        Returns:
        the namespace URI to which the given prefix is mapped.
        Throws:
        NamespaceException - if the prefix is unknown.