One noteworthy feature of the class is that it is designed to allow "short-term recycling", ie. instances can be reused within context of a simple document output. While reuse/recycling of such lightweight object is often useless or even counter productive, here it may be worth using, due to simplicity of the scheme (basically using a very simple free-elements linked list).
| Modifier and Type | Field and Description |
|---|---|
| protected static final BijectiveNsMap | |
| protected String | |
| protected BijectiveNsMap | mNsMapping
Mapping of namespace prefixes to URIs and back. |
| protected boolean | mNsMapShared
True, if |
| protected NamespaceContext | mRootNsContext
Namespace context end application may have supplied, and that (if given) should be used to augment explicitly defined bindings. |
| public static final int | |
| public static final int | |
| public static final int | |
| protected static final String | |
| protected static final String |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final String | |
| public final String | |
| public final String | getExplicitPrefix(String uri)
Method similar to |
| public abstract String | Returns: String presentation of the fully-qualified name, in "prefix:localName" format (no URI). Useful for error and debugging messages.
|
| public final String | getNamespaceURI(String
prefix to look up prefix)Implements javax. Get Namespace URI bound to a prefix in the current scope. |
| public final String | getPrefix(String
URI of Namespace to lookup uri)Implements javax. Get prefix bound to Namespace URI in the current scope. |
| public final Iterator | getPrefixes(String
URI of Namespace to lookup uri)Implements javax. Get all prefixes bound to a Namespace URI in the current scope. |
| public final int | Returns: PREFIX_OK, if passed-in prefix matches matched-in namespace URI in current scope; PREFIX_UNBOUND if it's not bound to anything, and PREFIX_MISBOUND if it's bound to another URI.If true, rules for the default NS are those of elements
(ie. empty prefix can map to non-default namespace); if false,
rules are those of attributes (only non-default prefix can map to
a non-default namespace). isElement)Method that verifies that passed-in prefix indeed maps to the specified namespace URI; and depending on how it goes returns a status for caller. |
| public abstract boolean | |
| protected void | |
| public abstract void | |
| protected abstract void | |
| protected final void |
| DEFAULT_XML_BINDINGS | back to summary |
|---|---|
| protected static final BijectiveNsMap DEFAULT_XML_BINDINGS | |
| mDefaultNsURI | back to summary |
|---|---|
| protected String mDefaultNsURI | |
| mNsMapping | back to summary |
|---|---|
| protected BijectiveNsMap mNsMapping Mapping of namespace prefixes to URIs and back. | |
| mNsMapShared | back to summary |
|---|---|
| protected boolean mNsMapShared True, if | |
| mRootNsContext | back to summary |
|---|---|
| protected NamespaceContext mRootNsContext Namespace context end application may have supplied, and that (if given) should be used to augment explicitly defined bindings. | |
| PREFIX_MISBOUND | back to summary |
|---|---|
| public static final int PREFIX_MISBOUND | |
| PREFIX_OK | back to summary |
|---|---|
| public static final int PREFIX_OK | |
| PREFIX_UNBOUND | back to summary |
|---|---|
| public static final int PREFIX_UNBOUND | |
| sXmlNsPrefix | back to summary |
|---|---|
| protected static final String sXmlNsPrefix | |
| sXmlNsURI | back to summary |
|---|---|
| protected static final String sXmlNsURI | |
| OutputElementBase | back to summary |
|---|---|
| protected OutputElementBase() Constructor for the virtual root element | |
| OutputElementBase | back to summary |
|---|---|
| protected OutputElementBase(OutputElementBase parent, BijectiveNsMap ns) | |
| addPrefix | back to summary |
|---|---|
| public final void addPrefix(String prefix, String uri) | |
| generateMapping | back to summary |
|---|---|
| public final String generateMapping(String prefixBase, String uri, int[] seqArr) | |
| getDefaultNsUri | back to summary |
|---|---|
| public final String getDefaultNsUri() | |
| getExplicitPrefix | back to summary |
|---|---|
| public final String getExplicitPrefix(String uri) Method similar to | |
| getNameDesc | back to summary |
|---|---|
public abstract String getNameDesc()
| |
| getNamespaceURI | back to summary | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final String getNamespaceURI(String prefix) Implements javax. Doc from javax. Get Namespace URI bound to a prefix in the current scope. When requesting a Namespace URI by prefix, the following table describes the returned Namespace URI value for all possible prefix values:
| |||||||||||||||
| getPrefix | back to summary | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final String getPrefix(String uri) Implements javax. Doc from javax. Get prefix bound to Namespace URI in the current scope. To get all prefixes bound to a Namespace URI in the current
scope, use When requesting a prefix by Namespace URI, the following table describes the returned prefix value for all Namespace URI values:
| |||||||||||||||
| getPrefixes | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final Iterator Implements javax. Doc from javax. Get all prefixes bound to a Namespace URI in the current scope. An Iterator over String elements is returned in an arbitrary, implementation dependent, order. The When requesting prefixes by Namespace URI, the following table describes the returned prefixes value for all Namespace URI values:
| |||||||||||||
| isPrefixValid | back to summary |
|---|---|
| public final int isPrefixValid(String prefix, String nsURI, boolean isElement) throws XMLStreamException Method that verifies that passed-in prefix indeed maps to the specified namespace URI; and depending on how it goes returns a status for caller.
| |
| isRoot | back to summary |
|---|---|
| public abstract boolean isRoot() | |
| relink | back to summary |
|---|---|
| protected void relink(OutputElementBase parent) Method called to reuse a pooled instance. | |
| setDefaultNsUri | back to summary |
|---|---|
| public abstract void setDefaultNsUri(String uri) | |
| setRootNsContext | back to summary |
|---|---|
| protected abstract void setRootNsContext(NamespaceContext ctxt) | |
| throwOutputError | back to summary |
|---|---|
| protected final void throwOutputError(String msg) throws XMLStreamException | |