static final class NamespaceSupport.Context extends Object
This module caches and reuses Namespace contexts, so the number allocated will be equal to the element depth of the document, not to the total number of elements (i.e. 5-10 rather than tens of thousands).
Modifier and Type | Field and Description |
---|---|
(package private) HashMap |
attributeNameTable |
(package private) String |
defaultNS |
(package private) HashMap |
elementNameTable |
(package private) HashMap |
prefixTable |
(package private) HashMap |
uriTable |
Constructor and Description |
---|
Context()
Create the root-level Namespace context.
|
Context(NamespaceSupport.Context that,
NamespaceSupport.Context newParent) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
declarePrefix(String prefix,
String uri)
Declare a Namespace prefix for this context.
|
(package private) Iterable<String> |
getDeclaredPrefixes()
Return an enumeration of prefixes declared in this context.
|
(package private) String |
getPrefix(String uri)
Look up one of the prefixes associated with a URI in this context.
|
(package private) Iterable<String> |
getPrefixes()
Return an enumeration of all prefixes currently in force.
|
(package private) String |
getURI(String prefix)
Look up the URI associated with a prefix in this context.
|
(package private) String[] |
processName(String qName,
boolean isAttribute)
Process a raw XML 1.0 name in this context.
|
(package private) void |
setParent(NamespaceSupport.Context parent)
(Re)set the parent of this Namespace context.
|
HashMap prefixTable
HashMap uriTable
HashMap elementNameTable
HashMap attributeNameTable
String defaultNS
Context()
Context(NamespaceSupport.Context that, NamespaceSupport.Context newParent)
void setParent(NamespaceSupport.Context parent)
parent
- The parent Namespace context object.void declarePrefix(String prefix, String uri)
prefix
- The prefix to declare.uri
- The associated Namespace URI.NamespaceSupport.declarePrefix(java.lang.String, java.lang.String)
String[] processName(String qName, boolean isAttribute)
qName
- The raw XML 1.0 name.isAttribute
- true if this is an attribute name.NamespaceSupport.processName(java.lang.String, java.lang.String[], boolean)
String getURI(String prefix)
prefix
- The prefix to look up.NamespaceSupport.getURI(java.lang.String)
String getPrefix(String uri)
Since many prefixes may be mapped to the same URI, the return value may be unreliable.
uri
- The URI to look up.NamespaceSupport.getPrefix(java.lang.String)
Iterable<String> getDeclaredPrefixes()
NamespaceSupport.getDeclaredPrefixes()
Iterable<String> getPrefixes()
The default prefix, if in force, is not returned, and will have to be checked for separately.
NamespaceSupport.getPrefixes()
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.