Package com.ctc.wstx.util
Class BaseNsContext
- java.lang.Object
-
- com.ctc.wstx.util.BaseNsContext
-
- All Implemented Interfaces:
NamespaceContext
- Direct Known Subclasses:
CompactNsContext,EmptyNamespaceContext,MergedNsContext
public abstract class BaseNsContext extends Object implements 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 StringUNDECLARED_NS_URIThis 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 StringdoGetNamespaceURI(String prefix)abstract StringdoGetPrefix(String nsURI)abstract Iterator<String>doGetPrefixes(String nsURI)abstract Iterator<Namespace>getNamespaces()StringgetNamespaceURI(String prefix)StringgetPrefix(String nsURI)Iterator<String>getPrefixes(String nsURI)abstract voidoutputNamespaceDeclarations(Writer w)Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.abstract voidoutputNamespaceDeclarations(XMLStreamWriter w)
-
-
-
Field Detail
-
UNDECLARED_NS_URI
protected static final 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
-
-
Method Detail
-
getNamespaceURI
public final String getNamespaceURI(String prefix)
- Specified by:
getNamespaceURIin interfaceNamespaceContext
-
getPrefix
public final String getPrefix(String nsURI)
- Specified by:
getPrefixin interfaceNamespaceContext
-
getPrefixes
public final Iterator<String> getPrefixes(String nsURI)
- Specified by:
getPrefixesin interfaceNamespaceContext
-
outputNamespaceDeclarations
public abstract void outputNamespaceDeclarations(Writer w) throws IOException
Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.- Throws:
IOException
-
outputNamespaceDeclarations
public abstract void outputNamespaceDeclarations(XMLStreamWriter w) throws XMLStreamException
- Throws:
XMLStreamException
-
-