public final class CompactNsContext extends BaseNsContext
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.
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
mFirstLocalNs
Index of first namespace pair in mNamespaces that is declared
in scope of element for which this context was constructed.
|
(package private) javax.xml.stream.Location |
mLocation |
(package private) java.lang.String[] |
mNamespaces
Array that contains 2 Strings for each declared default namespace
(including default namespace declarations); first is the prefix,
second URI.
|
(package private) int |
mNsLength
Number of entries in
mNamespaces (which is twice the number
of bindings) |
(package private) java.util.ArrayList<javax.xml.stream.events.Namespace> |
mNsList
List only needed to support List accessor from start-element event;
created lazily if/as needed.
|
UNDECLARED_NS_URI| Constructor and Description |
|---|
CompactNsContext(javax.xml.stream.Location loc,
java.lang.String[] namespaces,
int nsLen,
int firstLocal) |
| Modifier and Type | Method and Description |
|---|---|
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() |
void |
outputNamespaceDeclarations(java.io.Writer w)
Method called by
CompactStartElement
to output all 'local' namespace declarations active in current
namespace scope, if any. |
void |
outputNamespaceDeclarations(javax.xml.stream.XMLStreamWriter w) |
getNamespaceURI, getPrefix, getPrefixesfinal javax.xml.stream.Location mLocation
final java.lang.String[] mNamespaces
final int mNsLength
mNamespaces (which is twice the number
of bindings)final int mFirstLocalNs
mNsLength (which indicates there are no local
bindings).transient java.util.ArrayList<javax.xml.stream.events.Namespace> mNsList
public CompactNsContext(javax.xml.stream.Location loc,
java.lang.String[] namespaces,
int nsLen,
int firstLocal)
public java.lang.String doGetNamespaceURI(java.lang.String prefix)
doGetNamespaceURI in class BaseNsContextprefix - Non-null, non-empty prefix (base-class verifies these
constraints) to find namespace URI for.public java.lang.String doGetPrefix(java.lang.String nsURI)
doGetPrefix in class BaseNsContextpublic java.util.Iterator<java.lang.String> doGetPrefixes(java.lang.String nsURI)
doGetPrefixes in class BaseNsContextpublic java.util.Iterator<javax.xml.stream.events.Namespace> getNamespaces()
getNamespaces in class BaseNsContextpublic void outputNamespaceDeclarations(java.io.Writer w)
throws java.io.IOException
CompactStartElement
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.outputNamespaceDeclarations in class BaseNsContextjava.io.IOExceptionpublic void outputNamespaceDeclarations(javax.xml.stream.XMLStreamWriter w)
throws javax.xml.stream.XMLStreamException
outputNamespaceDeclarations in class BaseNsContextjavax.xml.stream.XMLStreamException