For example:
When the
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private int | count
This member is continually incremented when new prefixes need to be generated. |
| private static final String | |
| private HashMap | m_namespaces
Each entry (prefix) in this hashmap points to a Stack of URIs This maps a prefix (String) to a Stack of prefix mappings. |
| private Stack | m_nodeStack
The top of this stack contains the MapRecord of the last declared a namespace. |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public String | Returns: String a new namespace prefix ( ns0, ns1, ns2 ...)Generate a new namespace prefix ( ns0, ns1 ...) not used before |
| pack-priv NamespaceMappings. | |
| pack-priv NamespaceMappings. | |
| private void | initNamespaces()
This method initializes the namespace object with appropriate stacks and predefines a few prefix/uri pairs which always exist. |
| public String | Returns: the URI corresponding to the prefixString the prefix of the namespace prefix)Use a namespace prefix to lookup a namespace URI. |
| public String | Returns: an existing prefix that maps to the given URI, null if no prefix maps to the given namespace URI.the namespace URI to be search for uri)Given a namespace uri, and the namespaces mappings for the current element, return the current prefix for that uri. |
| pack-priv boolean | |
| pack-priv void | popNamespaces(int
the element depth for which mappings declared at this
depth or deeper will no longer be valid elemDepth, ContentHandler The ContentHandler to notify of any endPrefixMapping()
calls. This parameter can be null. saxHandler)Pop, or undeclare all namespace definitions that are currently declared at the given element depth, or deepter. |
| pack-priv boolean | pushNamespace(String
a String with the prefix for a qualified name prefix, String a String with the uri to which the prefix is to map uri, int the depth of current declaration elemDepth)Declare a mapping of a prefix to namespace URI at the given element depth. |
| pack-priv final void |
| count | back to summary |
|---|---|
| private int count This member is continually incremented when new prefixes need to be generated. ("ns0" "ns1" ...) | |
| EMPTYSTRING | back to summary |
|---|---|
| private static final String EMPTYSTRING | |
| m_namespaces | back to summary |
|---|---|
| private HashMap<String, Stack<NamespaceMappings. Each entry (prefix) in this hashmap points to a Stack of URIs This maps a prefix (String) to a Stack of prefix mappings. All mappings in that retrieved stack have the same prefix, though possibly different URI's or depths. Such a stack must have mappings at deeper depths push later on such a stack. Mappings pushed earlier on the stack will have smaller values for MappingRecord.m_declarationDepth. | |
| m_nodeStack | back to summary |
|---|---|
| private Stack<NamespaceMappings. The top of this stack contains the MapRecord of the last declared a namespace. Used to know how many prefix mappings to pop when leaving the current element depth. For every prefix mapping the current element depth is pushed on this stack. That way all prefixes pushed at the current depth can be removed at the same time. Used to ensure prefix/uri map scopes are closed correctly | |
| XML_PREFIX | back to summary |
|---|---|
| private static final String XML_PREFIX | |
| NamespaceMappings | back to summary |
|---|---|
| public NamespaceMappings() Default constructor
| |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. This method makes a clone of this object.
| |
| generateNextPrefix | back to summary |
|---|---|
| public String generateNextPrefix() Generate a new namespace prefix ( ns0, ns1 ...) not used before
| |
| getMappingFromPrefix | back to summary |
|---|---|
| pack-priv NamespaceMappings. | |
| getMappingFromURI | back to summary |
|---|---|
| pack-priv NamespaceMappings. | |
| initNamespaces | back to summary |
|---|---|
| private void initNamespaces() This method initializes the namespace object with appropriate stacks and predefines a few prefix/uri pairs which always exist. | |
| lookupNamespace | back to summary |
|---|---|
| public String lookupNamespace(String prefix) Use a namespace prefix to lookup a namespace URI. | |
| lookupPrefix | back to summary |
|---|---|
| public String lookupPrefix(String uri) Given a namespace uri, and the namespaces mappings for the current element, return the current prefix for that uri. | |
| popNamespace | back to summary |
|---|---|
| pack-priv boolean popNamespace(String prefix) Undeclare the namespace that is currently pointed to by a given prefix | |
| popNamespaces | back to summary |
|---|---|
| pack-priv void popNamespaces(int elemDepth, ContentHandler saxHandler) Pop, or undeclare all namespace definitions that are currently declared at the given element depth, or deepter.
| |
| pushNamespace | back to summary |
|---|---|
| pack-priv boolean pushNamespace(String prefix, String uri, int elemDepth) Declare a mapping of a prefix to namespace URI at the given element depth. | |
| reset | back to summary |
|---|---|
| pack-priv final void reset() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| pack-priv final String | |
| pack-priv final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| m_declarationDepth | back to summary |
|---|---|
| pack-priv final int m_declarationDepth | |
| m_prefix | back to summary |
|---|---|
| pack-priv final String m_prefix | |
| m_uri | back to summary |
|---|---|
| pack-priv final String m_uri | |
| MappingRecord | back to summary |
|---|---|
| pack-priv MappingRecord(String prefix, String uri, int depth) | |