Package com.ctc.wstx.sr
Class CompactNsContext
- java.lang.Object
-
- com.ctc.wstx.util.BaseNsContext
-
- com.ctc.wstx.sr.CompactNsContext
-
- All Implemented Interfaces:
NamespaceContext
public final class CompactNsContext extends BaseNsContext
Simple implementation of separate non-transient namespace context object. Created for start-element event by transient namespace instance updated by stream reader.Note about implementation: Location information is only needed (and only needs to passed) if access is made via extended interface; one that can return information about actual Namespace event objects.
-
-
Field Summary
-
Fields inherited from class com.ctc.wstx.util.BaseNsContext
UNDECLARED_NS_URI
-
-
Constructor Summary
Constructors Constructor Description CompactNsContext(Location loc, String[] namespaces, int nsLen, int firstLocal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
doGetNamespaceURI(String prefix)
String
doGetPrefix(String nsURI)
Iterator<String>
doGetPrefixes(String nsURI)
Iterator<Namespace>
getNamespaces()
void
outputNamespaceDeclarations(Writer w)
Method called byCompactStartElement
to output all 'local' namespace declarations active in current namespace scope, if any.void
outputNamespaceDeclarations(XMLStreamWriter w)
-
Methods inherited from class com.ctc.wstx.util.BaseNsContext
getNamespaceURI, getPrefix, getPrefixes
-
-
-
-
Method Detail
-
doGetNamespaceURI
public String doGetNamespaceURI(String prefix)
- Specified by:
doGetNamespaceURI
in classBaseNsContext
- Parameters:
prefix
- Non-null, non-empty prefix (base-class verifies these constraints) to find namespace URI for.
-
doGetPrefix
public String doGetPrefix(String nsURI)
- Specified by:
doGetPrefix
in classBaseNsContext
-
doGetPrefixes
public Iterator<String> doGetPrefixes(String nsURI)
- Specified by:
doGetPrefixes
in classBaseNsContext
-
getNamespaces
public Iterator<Namespace> getNamespaces()
- Specified by:
getNamespaces
in classBaseNsContext
-
outputNamespaceDeclarations
public void outputNamespaceDeclarations(Writer w) throws IOException
Method called byCompactStartElement
to output all 'local' namespace declarations active in current namespace scope, if any. Local means that declaration was done in scope of current element, not in a parent element.- Specified by:
outputNamespaceDeclarations
in classBaseNsContext
- Throws:
IOException
-
outputNamespaceDeclarations
public void outputNamespaceDeclarations(XMLStreamWriter w) throws XMLStreamException
- Specified by:
outputNamespaceDeclarations
in classBaseNsContext
- Throws:
XMLStreamException
-
-