Class NamespaceStack
- java.lang.Object
-
- org.apache.maven.archetype.common.util.NamespaceStack
-
- Direct Known Subclasses:
XMLOutputter.NamespaceStack
class NamespaceStack extends java.lang.ObjectA non-public utility class used byto manage namespaces in a JDOM Document during output.XMLOutputter
-
-
Constructor Summary
Constructors Constructor Description NamespaceStack()This creates the needed storage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetURI(java.lang.String prefix)Given a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.java.lang.Stringpop()This will remove the topmost (most recently added), and return its prefix.Namespacevoidpush(org.jdom.Namespace ns)This will add a newto those currently available.Namespaceintsize()This returns the number of available namespaces.java.lang.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(org.jdom.Namespace ns)
This will add a newto those currently available.Namespace- Parameters:
ns-Namespaceto add.
-
pop
public java.lang.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 java.lang.String getURI(java.lang.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.
-
toString
public java.lang.String toString()
This will print out the size and current stack, from the most recently addedto the "oldest," all toNamespaceSystem.out.- Overrides:
toStringin classjava.lang.Object
-
-