Package org.apache.cxf.helpers
Class NSStack
- java.lang.Object
- 
- org.apache.cxf.helpers.NSStack
 
- 
 public class NSStack extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description NSStack()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringadd(String uri)Add a new declaration to the current scope using a unique prefix and return the prefix.voidadd(String prefix, String uri)Add a new declaration to the current scope.StringgetPrefix(String uri)Return the prefix associated with the given namespace name by looking thru all the namespace declarations that are in scope.StringgetURI(String prefix)Return the namespace name associated with the given prefix by looking thru all the namespace declarations that are in scope.voidpop()Leave a scope: this removes any NS declarations that were added in the last scope.voidpush()
 
- 
- 
- 
Method Detail- 
pushpublic void push() 
 - 
poppublic void pop() Leave a scope: this removes any NS declarations that were added in the last scope. Note that I don't bother to validate that you don't call popScope too many times; that's your problem.
 - 
addpublic void add(String prefix, String uri) Add a new declaration to the current scope. This is visible within the current scope as well as from any nested scopes.- Parameters:
- prefix- the prefix to be used for this namespace
- uri- the namespace name of this namespace.
 
 - 
addpublic String add(String uri) Add a new declaration to the current scope using a unique prefix and return the prefix. This is useful when one just wants to add a decl and doesn't want to have to deal with creating unique prefixes. If the namespace name is already declared and in scope, then the previously declared prefix is returned.- Parameters:
- uri- the namespace name of this namespace
- Returns:
- the unique prefix created or previously declared for this namespace
 
 - 
getPrefixpublic String getPrefix(String uri) Return the prefix associated with the given namespace name by looking thru all the namespace declarations that are in scope.- Parameters:
- uri- the namespace name for whom a declared prefix is desired
- Returns:
- the prefix or null if namespace name not found
 
 - 
getURIpublic String getURI(String prefix) Return the namespace name associated with the given prefix by looking thru all the namespace declarations that are in scope.- Parameters:
- prefix- the prefix for whom a declared namespace name is desired
- Returns:
- the namespace name or null if prefix not found
 
 
- 
 
-