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 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 String
doGetNamespaceURI(String prefix)
abstract String
doGetPrefix(String nsURI)
abstract Iterator<String>
doGetPrefixes(String nsURI)
abstract Iterator<Namespace>
getNamespaces()
String
getNamespaceURI(String prefix)
String
getPrefix(String nsURI)
Iterator<String>
getPrefixes(String nsURI)
abstract void
outputNamespaceDeclarations(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(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:
getNamespaceURI
in interfaceNamespaceContext
-
getPrefix
public final String getPrefix(String nsURI)
- Specified by:
getPrefix
in interfaceNamespaceContext
-
getPrefixes
public final Iterator<String> getPrefixes(String nsURI)
- Specified by:
getPrefixes
in 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
-
-