Class BaseNsContext

  • All Implemented Interfaces:
    javax.xml.namespace.NamespaceContext
    Direct Known Subclasses:
    CompactNsContext, EmptyNamespaceContext, MergedNsContext

    public abstract class BaseNsContext
    extends java.lang.Object
    implements javax.xml.namespace.NamespaceContext
    Abstract base class that defines extra features defined by most NamespaceContext implementations Wodstox uses.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String UNDECLARED_NS_URI
      This is the URI returned for default namespace, when it hasn't been explicitly declared; could be either "" or null.
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseNsContext()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String doGetNamespaceURI​(java.lang.String prefix)  
      abstract java.lang.String doGetPrefix​(java.lang.String nsURI)  
      abstract java.util.Iterator<java.lang.String> doGetPrefixes​(java.lang.String nsURI)  
      abstract java.util.Iterator<javax.xml.stream.events.Namespace> getNamespaces()  
      java.lang.String getNamespaceURI​(java.lang.String prefix)  
      java.lang.String getPrefix​(java.lang.String nsURI)  
      java.util.Iterator<java.lang.String> getPrefixes​(java.lang.String nsURI)  
      abstract void outputNamespaceDeclarations​(java.io.Writer w)
      Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.
      abstract void outputNamespaceDeclarations​(javax.xml.stream.XMLStreamWriter w)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UNDECLARED_NS_URI

        protected static final java.lang.String UNDECLARED_NS_URI
        This is the URI returned for default namespace, when it hasn't been explicitly declared; could be either "" or null.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseNsContext

        public BaseNsContext()
    • Method Detail

      • getNamespaceURI

        public final java.lang.String getNamespaceURI​(java.lang.String prefix)
        Specified by:
        getNamespaceURI in interface javax.xml.namespace.NamespaceContext
      • getPrefix

        public final java.lang.String getPrefix​(java.lang.String nsURI)
        Specified by:
        getPrefix in interface javax.xml.namespace.NamespaceContext
      • getPrefixes

        public final java.util.Iterator<java.lang.String> getPrefixes​(java.lang.String nsURI)
        Specified by:
        getPrefixes in interface javax.xml.namespace.NamespaceContext
      • getNamespaces

        public abstract java.util.Iterator<javax.xml.stream.events.Namespace> getNamespaces()
      • outputNamespaceDeclarations

        public abstract void outputNamespaceDeclarations​(java.io.Writer w)
                                                  throws java.io.IOException
        Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.
        Throws:
        java.io.IOException
      • outputNamespaceDeclarations

        public abstract void outputNamespaceDeclarations​(javax.xml.stream.XMLStreamWriter w)
                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • doGetNamespaceURI

        public abstract java.lang.String doGetNamespaceURI​(java.lang.String prefix)
      • doGetPrefix

        public abstract java.lang.String doGetPrefix​(java.lang.String nsURI)
      • doGetPrefixes

        public abstract java.util.Iterator<java.lang.String> doGetPrefixes​(java.lang.String nsURI)