class NamespaceStack
extends java.lang.Object
XMLOutputter and
SAXOutputter to manage namespaces in a JDOM Document
during output.| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
CVS_ID |
private java.util.Stack<java.lang.String> |
prefixes
The prefixes available
|
private java.util.Stack<java.lang.String> |
uris
The URIs available
|
| Constructor and Description |
|---|
NamespaceStack()
This creates the needed storage.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getURI(java.lang.String prefix)
Given a prefix, this will return the namespace URI most
rencently (topmost) associated with that prefix.
|
java.lang.String |
pop()
This will remove the topmost (most recently added)
, and return its prefix. |
void |
push(org.jdom.Namespace ns)
This will add a new
to those currently available. |
int |
size()
This returns the number of available namespaces.
|
java.lang.String |
toString()
This will print out the size and current stack, from the
most recently added
to
the "oldest," all to System.out. |
private static final java.lang.String CVS_ID
private java.util.Stack<java.lang.String> prefixes
private java.util.Stack<java.lang.String> uris
public void push(org.jdom.Namespace ns)
Namespace
to those currently available.ns - Namespace to add.public java.lang.String pop()
Namespace, and return its prefix.String - the popped namespace prefix.public int size()
int - size of the namespace stack.public java.lang.String getURI(java.lang.String prefix)
prefix - String namespace prefix.String - the namespace URI for that prefix.public java.lang.String toString()
Namespace to
the "oldest," all to System.out.toString in class java.lang.Object