|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis.utils.NSStack
The abstraction this class provides is a push down stack of variable length frames of prefix to namespace mappings. Used for keeping track of what namespaces are active at any given point as an XML document is traversed or produced. From a performance point of view, this data will both be modified frequently (at a minimum, there will be one push and pop per XML element processed), and scanned frequently (many of the "good" mappings will be at the bottom of the stack). The one saving grace is that the expected maximum cardinalities of the number of frames and the number of total mappings is only in the dozens, representing the nesting depth of an XML document and the number of active namespaces at any point in the processing. Accordingly, this stack is implemented as a single array, will null values used to indicate frame boundaries.
Constructor Summary | |
NSStack()
|
|
NSStack(boolean optimizePrefixes)
|
Method Summary | |
void |
add(java.lang.String namespaceURI,
java.lang.String prefix)
Add a mapping for a namespaceURI to the specified prefix to the top frame in the stack. |
java.util.ArrayList |
cloneFrame()
Return a copy of the current frame. |
void |
dump(java.lang.String dumpPrefix)
Produce a trace dump of the entire stack, starting from the top and including frame markers. |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
Given a prefix, return the associated namespace (if any). |
java.lang.String |
getPrefix(java.lang.String namespaceURI)
Return an active prefix for the given namespaceURI, including the default prefix (""). |
java.lang.String |
getPrefix(java.lang.String namespaceURI,
boolean noDefault)
Return an active prefix for the given namespaceURI. |
Mapping |
next()
Return the next namespace mapping in the top frame. |
void |
pop()
Remove the top frame from the stack. |
void |
push()
Create a new frame at the top of the stack. |
Mapping |
topOfFrame()
Reset the embedded iterator in this class to the top of the current (i.e., last) frame. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NSStack(boolean optimizePrefixes)
public NSStack()
Method Detail |
public void push()
public void pop()
public java.util.ArrayList cloneFrame()
public Mapping topOfFrame()
public Mapping next()
public void add(java.lang.String namespaceURI, java.lang.String prefix)
public java.lang.String getPrefix(java.lang.String namespaceURI, boolean noDefault)
public java.lang.String getPrefix(java.lang.String namespaceURI)
public java.lang.String getNamespaceURI(java.lang.String prefix)
public void dump(java.lang.String dumpPrefix)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |