com.sun.xml.bind.v2.runtime.output
public final class NamespaceContextImpl extends Object implements NamespaceContext2
This class is also used to keep track of tag names for each element for the marshaller (for the performance reason.)
| Nested Class Summary | |
|---|---|
| class | NamespaceContextImpl.Element
This model of namespace declarations maintain the following invariants.
|
| Field Summary | |
|---|---|
| boolean | collectionMode
True to allow new URIs to be declared. |
| Constructor Summary | |
|---|---|
| NamespaceContextImpl(XMLSerializer owner) | |
| Method Summary | |
|---|---|
| int | count()
Number of total bindings declared. |
| String | declareNamespace(String namespaceUri, String preferedPrefix, boolean requirePrefix) |
| int | declareNsUri(String uri, String preferedPrefix, boolean requirePrefix)
Returns the prefix index to the specified URI.
|
| int | force(String uri, String prefix) |
| NamespaceContextImpl.Element | getCurrent() |
| String | getNamespaceURI(int prefixIndex) |
| String | getNamespaceURI(String prefix)
Gets the namespace URI that is bound to the specified prefix.
|
| String | getPrefix(int prefixIndex)
Gets the prefix from a prefix index.
|
| String | getPrefix(String uri)
Returns the prefix of the specified URI,
or null if none exists. |
| Iterator<String> | getPrefixes(String uri) |
| int | getPrefixIndex(String uri)
Returns the prefix index of the specified URI.
|
| NamespacePrefixMapper | getPrefixMapper() |
| int | put(String uri, String prefix)
Puts this new binding into the declared prefixes list
without doing any duplicate check.
|
| void | reset() |
| void | setPrefixMapper(NamespacePrefixMapper mapper) |
Returns: null if the prefix is unbound.
Most of the time NamespaceContextImpl shall be used.
Returns: the index of this new binding.