Top Description Fields Constructors Methods
org.jdom.output

pack-priv Class NamespaceStack

extends Object
Class Inheritance
Known Direct Subclasses
org.jdom.output.XMLOutputter.NamespaceStack
Imports
java.util.*, org.jdom.Namespace

A non-public utility class used by both XMLOutputter and SAXOutputter to manage namespaces in a JDOM Document during output.
Authors
Elliotte Rusty Harolde, Fred Trimble, Brett McLaughlin
Version
$Revision: 1.14 $, $Date: 2007/11/10 05:29:01 $

Field Summary

Modifier and TypeField and Description
private static final String
private Stack<E>
prefixes

The prefixes available

private Stack<E>
uris

The URIs available

Constructor Summary

AccessConstructor and Description
pack-priv
NamespaceStack()

This creates the needed storage.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

String - the namespace URI for that prefix.
getURI
(String
String namespace prefix.
prefix
)

Given a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.

public String

Returns:

String - the popped namespace prefix.
pop
()

This will remove the topmost (most recently added) Namespace, and return its prefix.

public void
push(Namespace
Namespace to add.
ns
)

This will add a new Namespace to those currently available.

public int

Returns:

int - size of the namespace stack.
size
()

This returns the number of available namespaces.

public String
toString()

Overrides java.lang.Object.toString.

This will print out the size and current stack, from the most recently added Namespace to the "oldest," all to System.out.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CVS_IDback to summary
private static final String CVS_ID
prefixesback to summary
private Stack<E> prefixes

The prefixes available

urisback to summary
private Stack<E> uris

The URIs available

Constructor Detail

NamespaceStackback to summary
pack-priv NamespaceStack()

This creates the needed storage.

Method Detail

getURIback to summary
public String getURI(String prefix)

Given a prefix, this will return the namespace URI most rencently (topmost) associated with that prefix.

Parameters
prefix:String

String namespace prefix.

Returns:String

String - the namespace URI for that prefix.

popback to summary
public String pop()

This will remove the topmost (most recently added) Namespace, and return its prefix.

Returns:String

String - the popped namespace prefix.

pushback to summary
public void push(Namespace ns)

This will add a new Namespace to those currently available.

Parameters
ns:Namespace

Namespace to add.

sizeback to summary
public int size()

This returns the number of available namespaces.

Returns:int

int - size of the namespace stack.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

This will print out the size and current stack, from the most recently added Namespace to the "oldest," all to System.out.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.