Class XMLOutputter.NamespaceStack
java.lang.Object
org.apache.maven.archetype.common.util.XMLOutputter.NamespaceStack
- Enclosing class:
XMLOutputter
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
-
Method Summary
Modifier and TypeMethodDescriptionGiven a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.pop()
This will remove the topmost (most recently added)
, and return its prefix.Namespace
void
push
(org.jdom2.Namespace ns) This will add a new
to those currently available.Namespace
int
size()
This returns the number of available namespaces.toString()
This will print out the size and current stack, from the most recently added
to the "oldest," all toNamespace
System.out
.
-
Constructor Details
-
NamespaceStack
protected NamespaceStack()
-
-
Method Details
-
push
public void push(org.jdom2.Namespace ns) This will add a new
to those currently available.Namespace
- Parameters:
ns
-Namespace
to add.
-
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
Given a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.- Parameters:
prefix
-String
namespace prefix.- Returns:
String
- the namespace URI for that prefix.
-
toString
This will print out the size and current stack, from the most recently added
to the "oldest," all toNamespace
System.out
.
-