Package org.apache.cxf.helpers
Class NSStack
java.lang.Object
org.apache.cxf.helpers.NSStack
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a new declaration to the current scope using a unique prefix and return the prefix.void
Add a new declaration to the current scope.Return the prefix associated with the given namespace name by looking thru all the namespace declarations that are in scope.Return the namespace name associated with the given prefix by looking thru all the namespace declarations that are in scope.void
pop()
Leave a scope: this removes any NS declarations that were added in the last scope.void
push()
-
Constructor Details
-
NSStack
public NSStack()
-
-
Method Details
-
push
public void push() -
pop
public 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. -
add
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 namespaceuri
- the namespace name of this namespace.
-
add
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
-
getPrefix
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
-
getURI
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
-