public class ScopedNamespaceContext extends AbstractNamespaceContext
NamespaceContext implementation that supports nested scopes. A scope is typically
associated with a start tag / end tag pair. The implementation takes care of correctly
handling masked namespace bindings. Masking occurs when the same prefix is bound to a different
namespace URI in a nested scope.| Constructor and Description |
|---|
ScopedNamespaceContext() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
doGetNamespaceURI(String prefix)
Get namespace URI bound to a prefix in the current scope.
|
protected String |
doGetPrefix(String namespaceURI)
Get prefix bound to namespace URI in the current scope.
|
protected Iterator |
doGetPrefixes(String namespaceURI)
Get all prefixes bound to a namespace URI in the current scope.
|
void |
endScope()
End the current scope and restore the scope in which the current scope was nested.
|
void |
setPrefix(String prefix,
String namespaceURI)
Define a prefix binding in the current scope.
|
void |
startScope()
Start a new scope.
|
getNamespaceURI, getPrefix, getPrefixespublic void setPrefix(String prefix, String namespaceURI)
prefix - the prefix to bind or the empty string to set the default namespace; may not
be nullnamespaceURI - the corresponding namespace URI; may not be nullpublic void startScope()
public void endScope()
startScope() method.protected String doGetNamespaceURI(String prefix)
AbstractNamespaceContextNamespaceContext.getNamespaceURI(String), except that the
implementation is not required to handle the implicit namespace bindings.doGetNamespaceURI in class AbstractNamespaceContextprefix - prefix to look upprotected String doGetPrefix(String namespaceURI)
AbstractNamespaceContextNamespaceContext.getPrefix(String),
except that the implementation is not required to handle the implicit
namespace bindings.doGetPrefix in class AbstractNamespaceContextnamespaceURI - URI of namespace to lookupprotected Iterator doGetPrefixes(String namespaceURI)
AbstractNamespaceContextNamespaceContext.getPrefixes(String), except that the
implementation is not required to handle the implicit namespace bindings.doGetPrefixes in class AbstractNamespaceContextnamespaceURI - URI of namespace to lookupCopyright © 2004–2016 The Apache Software Foundation. All rights reserved.