|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xml.serializer.NamespaceMappings
This class keeps track of the currently defined namespaces. Conceptually the prefix/uri/depth triplets are pushed on a stack pushed on a stack. The depth indicates the nesting depth of the element for which the mapping was made.
For example:
When the
Constructor Summary | |
NamespaceMappings()
Default constructor |
Method Summary | |
Object |
clone()
This method makes a clone of this object. |
String |
generateNextPrefix()
Generate a new namespace prefix ( ns0, ns1 ...) not used before |
String |
lookupNamespace(String prefix)
Use a namespace prefix to lookup a namespace URI. |
String |
lookupPrefix(String uri)
Given a namespace uri, and the namespaces mappings for the current element, return the current prefix for that uri. |
boolean |
popNamespace(String prefix)
Undeclare the namespace that is currently pointed to by a given prefix |
void |
popNamespaces(int elemDepth,
ContentHandler saxHandler)
Pop, or undeclare all namespace definitions that are currently declared at the given element depth, or deepter. |
boolean |
pushNamespace(String prefix,
String uri,
int elemDepth)
Declare a prefix to point to a namespace URI |
void |
reset()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NamespaceMappings()
Object.Object()
Method Detail |
public String lookupNamespace(String prefix)
prefix
- String the prefix of the namespace
public String lookupPrefix(String uri)
uri
- the namespace URI to be search for
public boolean popNamespace(String prefix)
public boolean pushNamespace(String prefix, String uri, int elemDepth)
prefix
- a String with the prefix for a qualified nameuri
- a String with the uri to which the prefix is to mapelemDepth
- the depth of current declarationpublic void popNamespaces(int elemDepth, ContentHandler saxHandler)
elemDepth
- the element depth for which mappings declared at this
depth or deeper will no longer be validsaxHandler
- The ContentHandler to notify of any endPrefixMapping()
calls. This parameter can be null.public String generateNextPrefix()
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
public final void reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |