Package com.ctc.wstx.evt
Class MergedNsContext
- java.lang.Object
-
- com.ctc.wstx.util.BaseNsContext
-
- com.ctc.wstx.evt.MergedNsContext
-
- All Implemented Interfaces:
javax.xml.namespace.NamespaceContext
public class MergedNsContext extends BaseNsContext
HierarchicNamespaceContext
implementation used when constructing event and namespace information explicitly viaXMLEventFactory
, not by a stream reader.TODO:
- Figure out a way to check for namespace masking; tricky but not impossible to determine
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<javax.xml.stream.events.Namespace>
mNamespaces
List ofNamespace
instances.(package private) java.util.Map<java.lang.String,javax.xml.stream.events.Namespace>
mNsByPrefix
(package private) java.util.Map<java.lang.String,javax.xml.stream.events.Namespace>
mNsByURI
(package private) javax.xml.namespace.NamespaceContext
mParentCtxt
-
Fields inherited from class com.ctc.wstx.util.BaseNsContext
UNDECLARED_NS_URI
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MergedNsContext(javax.xml.namespace.NamespaceContext parentCtxt, java.util.List<javax.xml.stream.events.Namespace> localNs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Map<java.lang.String,javax.xml.stream.events.Namespace>
buildByNsURIMap()
private java.util.Map<java.lang.String,javax.xml.stream.events.Namespace>
buildByPrefixMap()
static BaseNsContext
construct(javax.xml.namespace.NamespaceContext parentCtxt, java.util.List<javax.xml.stream.events.Namespace> localNs)
java.lang.String
doGetNamespaceURI(java.lang.String prefix)
java.lang.String
doGetPrefix(java.lang.String nsURI)
java.util.Iterator<java.lang.String>
doGetPrefixes(java.lang.String nsURI)
java.util.Iterator<javax.xml.stream.events.Namespace>
getNamespaces()
Method that returns information about namespace definition declared in this scope; not including ones declared in outer scopes.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.void
outputNamespaceDeclarations(javax.xml.stream.XMLStreamWriter w)
Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.-
Methods inherited from class com.ctc.wstx.util.BaseNsContext
getNamespaceURI, getPrefix, getPrefixes
-
-
-
-
Field Detail
-
mParentCtxt
final javax.xml.namespace.NamespaceContext mParentCtxt
-
mNamespaces
final java.util.List<javax.xml.stream.events.Namespace> mNamespaces
List ofNamespace
instances.
-
mNsByPrefix
java.util.Map<java.lang.String,javax.xml.stream.events.Namespace> mNsByPrefix
-
mNsByURI
java.util.Map<java.lang.String,javax.xml.stream.events.Namespace> mNsByURI
-
-
Method Detail
-
construct
public static BaseNsContext construct(javax.xml.namespace.NamespaceContext parentCtxt, java.util.List<javax.xml.stream.events.Namespace> localNs)
-
doGetNamespaceURI
public java.lang.String doGetNamespaceURI(java.lang.String prefix)
- Specified by:
doGetNamespaceURI
in classBaseNsContext
-
doGetPrefix
public java.lang.String doGetPrefix(java.lang.String nsURI)
- Specified by:
doGetPrefix
in classBaseNsContext
-
doGetPrefixes
public java.util.Iterator<java.lang.String> doGetPrefixes(java.lang.String nsURI)
- Specified by:
doGetPrefixes
in classBaseNsContext
-
getNamespaces
public java.util.Iterator<javax.xml.stream.events.Namespace> getNamespaces()
Method that returns information about namespace definition declared in this scope; not including ones declared in outer scopes.- Specified by:
getNamespaces
in classBaseNsContext
-
outputNamespaceDeclarations
public void outputNamespaceDeclarations(java.io.Writer w) throws java.io.IOException
Description copied from class:BaseNsContext
Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.- Specified by:
outputNamespaceDeclarations
in classBaseNsContext
- Throws:
java.io.IOException
-
outputNamespaceDeclarations
public void outputNamespaceDeclarations(javax.xml.stream.XMLStreamWriter w) throws javax.xml.stream.XMLStreamException
Method called by the matching start element class to output all namespace declarations active in current namespace scope, if any.- Specified by:
outputNamespaceDeclarations
in classBaseNsContext
- Throws:
javax.xml.stream.XMLStreamException
-
buildByPrefixMap
private java.util.Map<java.lang.String,javax.xml.stream.events.Namespace> buildByPrefixMap()
-
buildByNsURIMap
private java.util.Map<java.lang.String,javax.xml.stream.events.Namespace> buildByNsURIMap()
-
-