Modifier and Type | Class and Description |
---|---|
protected class | |
protected class |
Modifier and Type | Field and Description |
---|---|
protected int[] | fContext
Context indexes. |
protected int | fCurrentContext
The current context. |
protected String[] | fNamespace
Namespace binding information. |
protected int | fNamespaceSize
The top of the namespace information array. |
protected String[] |
Access | Constructor and Description |
---|---|
public | |
public | NamespaceSupport(NamespaceContext context)
Constructs a namespace context object and initializes it with the prefixes declared in the specified context. |
Modifier and Type | Method and Description |
---|---|
public boolean | Returns: true if the given prefix exists in the contextThe prefix to look up. prefix)Checks whether a binding or unbinding for the given prefix exists in the context. |
public boolean | Returns: true if the given prefix exists in the current contextThe prefix to look up. prefix)Checks whether a binding or unbinding for the given prefix exists in the current context. |
public boolean | declarePrefix(String
The prefix to declare, or null for the empty
string. prefix, String The Namespace URI to associate with the prefix. uri)Implements com. Declare a Namespace prefix. |
public Enumeration | getAllPrefixes()
Implements com. Return an enumeration of all prefixes whose declarations are active in the current context. |
public String | getDeclaredPrefixAt(int index)
Implements com. Returns the prefix at the specified index in the current context. |
public int | getDeclaredPrefixCount()
Implements com. Return a count of locally declared prefixes, including the default prefix if bound. |
public String | getPrefix(String
The namespace URI to look up. uri)Implements com. Look up a namespace URI and get one of the mapped prefix. |
public Iterator | |
public List | |
public String | getURI(String
The prefix to look up. prefix)Implements com. Look up a prefix and get the currently-mapped Namespace URI. |
public void | popContext()
Implements com. Revert to the previous Namespace context. |
public void | pushContext()
Implements com. Start a new Namespace context. |
public void | reset()
Implements com. Reset this Namespace support object for reuse. |
fContext | back to summary |
---|---|
protected int[] fContext Context indexes. This array contains indexes into the namespace information array. The index at the current context is the start index of declared namespace bindings and runs to the size of the namespace information array.
|
fCurrentContext | back to summary |
---|---|
protected int fCurrentContext The current context. |
fNamespace | back to summary |
---|---|
protected String[] fNamespace Namespace binding information. This array is composed of a series of tuples containing the namespace binding information: <prefix, uri>. The default size can be set to anything as long as it is a power of 2 greater than 1.
|
fNamespaceSize | back to summary |
---|---|
protected int fNamespaceSize The top of the namespace information array. |
fPrefixes | back to summary |
---|---|
protected String[] fPrefixes |
NamespaceSupport | back to summary |
---|---|
public NamespaceSupport() Default constructor. |
NamespaceSupport | back to summary |
---|---|
public NamespaceSupport(NamespaceContext context) Constructs a namespace context object and initializes it with the prefixes declared in the specified context. |
containsPrefix | back to summary |
---|---|
public boolean containsPrefix(String prefix) Checks whether a binding or unbinding for the given prefix exists in the context.
|
containsPrefixInCurrentContext | back to summary |
---|---|
public boolean containsPrefixInCurrentContext(String prefix) Checks whether a binding or unbinding for the given prefix exists in the current context.
|
declarePrefix | back to summary |
---|---|
public boolean declarePrefix(String prefix, String uri) Implements com. Doc from com. Declare a Namespace prefix. This method declares a prefix in the current Namespace context; the prefix will remain in force until this context is popped, unless it is shadowed in a descendant context. Note that to declare a default Namespace, use the empty string. The prefixes "xml" and "xmlns" can't be rebound. Note that you must not declare a prefix after you've pushed and popped another Namespace.
|
getAllPrefixes | back to summary |
---|---|
public Enumeration Implements com. Doc from com. Return an enumeration of all prefixes whose declarations are active in the current context. This includes declarations from parent contexts that have not been overridden.
|
getDeclaredPrefixAt | back to summary |
---|---|
public String getDeclaredPrefixAt(int index) Implements com. Doc from com. Returns the prefix at the specified index in the current context. |
getDeclaredPrefixCount | back to summary |
---|---|
public int getDeclaredPrefixCount() Implements com. Doc from com. Return a count of locally declared prefixes, including the default prefix if bound. |
getPrefix | back to summary |
---|---|
public String getPrefix(String uri) Implements com. Doc from com. Look up a namespace URI and get one of the mapped prefix. This method looks up the namespace URI in the current context. If more than one prefix is currently mapped to the same URI, this method will make an arbitrary selection If no mapping is found, this methods will continue lookup in the parent context(s).
|
getPrefixes | back to summary |
---|---|
public Iterator |
getPrefixes | back to summary |
---|---|
public List |
getURI | back to summary |
---|---|
public String getURI(String prefix) Implements com. Doc from com. Look up a prefix and get the currently-mapped Namespace URI. This method looks up the prefix in the current context. If no mapping is found, this methods will continue lookup in the parent context(s). Use the empty string ("") for the default Namespace.
|
popContext | back to summary |
---|---|
public void popContext() Implements com. Doc from com. Revert to the previous Namespace context. The context should be popped at the end of each XML element. After popping the context, all Namespace prefix mappings that were previously in force are restored. Users must not attempt to declare additional Namespace prefixes after popping a context, unless you push another context first. |
pushContext | back to summary |
---|---|
public void pushContext() Implements com. Doc from com. Start a new Namespace context. A new context should be pushed at the beginning of each XML element: the new context will automatically inherit the declarations of its parent context, but it will also keep track of which declarations were made within this context.
|
reset | back to summary |
---|---|
public void reset() Implements com. Doc from com. Reset this Namespace support object for reuse. It is necessary to invoke this method before reusing the Namespace support object for a new session. Note that implementations of this method need to ensure that the declaration of the prefixes "xmlns" and "xml" are available. |
Modifier and Type | Field and Description |
---|---|
private int | |
private String[] | |
private int |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public boolean | |
public String | |
public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
public String |
counter | back to summary |
---|---|
private int counter |
prefixes | back to summary |
---|---|
private String[] prefixes |
size | back to summary |
---|---|
private int size |
IteratorPrefixes | back to summary |
---|---|
public IteratorPrefixes(String[] prefixes, int size) Constructor for Prefixes. |
hasNext | back to summary |
---|---|
public boolean hasNext() Implements java. Doc from java. Returns
|
next | back to summary |
---|---|
public String next() Implements java. Doc from java. Returns the next element in the iteration.
|
remove | back to summary |
---|---|
public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
|
Modifier and Type | Field and Description |
---|---|
private int | |
private String[] | |
private int |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public boolean | hasMoreElements()
Implements java. Tests if this enumeration contains more elements. |
public String | nextElement()
Implements java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. |
public String |
counter | back to summary |
---|---|
private int counter |
prefixes | back to summary |
---|---|
private String[] prefixes |
size | back to summary |
---|---|
private int size |
Prefixes | back to summary |
---|---|
public Prefixes(String[] prefixes, int size) Constructor for Prefixes. |
hasMoreElements | back to summary |
---|---|
public boolean hasMoreElements() Implements java. Doc from java. Tests if this enumeration contains more elements.
|
nextElement | back to summary |
---|---|
public String nextElement() Implements java. Doc from java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
|