Package org.jdom.output
Class XMLOutputter.NamespaceStack
- java.lang.Object
-
- org.jdom.output.XMLOutputter.NamespaceStack
-
- Enclosing class:
- XMLOutputter
protected class XMLOutputter.NamespaceStack extends Object
Our own null subclass of NamespaceStack. This plays a little trick with Java access protection. We want subclasses of XMLOutputter to be able to override protected methods that declare a NamespaceStack parameter, but we don't want to declare the parent NamespaceStack class as public.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNamespaceStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetURI(String prefix)Given a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.Stringpop()This will remove the topmost (most recently added), and return its prefix.Namespacevoidpush(Namespace ns)This will add a newto those currently available.Namespaceintsize()This returns the number of available namespaces.StringtoString()This will print out the size and current stack, from the most recently addedto the "oldest," all toNamespaceSystem.out.
-
-
-
Method Detail
-
push
public void push(Namespace ns)
This will add a newto those currently available.Namespace- Parameters:
ns-Namespaceto add.
-
pop
public String pop()
This will remove the topmost (most recently added), and return its prefix.Namespace- Returns:
String- the popped namespace prefix.
-
size
public int size()
This returns the number of available namespaces.- Returns:
int- size of the namespace stack.
-
getURI
public String getURI(String prefix)
Given a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.- Parameters:
prefix-Stringnamespace prefix.- Returns:
String- the namespace URI for that prefix.
-
-