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, getPrefixes
public void setPrefix(String prefix, String namespaceURI)
prefix
- the prefix to bind or the empty string to set the default namespace; may not
be null
namespaceURI
- the corresponding namespace URI; may not be null
public void startScope()
public void endScope()
startScope()
method.protected String doGetNamespaceURI(String prefix)
AbstractNamespaceContext
NamespaceContext.getNamespaceURI(String)
, except that the
implementation is not required to handle the implicit namespace bindings.doGetNamespaceURI
in class AbstractNamespaceContext
prefix
- prefix to look upprotected String doGetPrefix(String namespaceURI)
AbstractNamespaceContext
NamespaceContext.getPrefix(String)
,
except that the implementation is not required to handle the implicit
namespace bindings.doGetPrefix
in class AbstractNamespaceContext
namespaceURI
- URI of namespace to lookupprotected Iterator doGetPrefixes(String namespaceURI)
AbstractNamespaceContext
NamespaceContext.getPrefixes(String)
, except that the
implementation is not required to handle the implicit namespace bindings.doGetPrefixes
in class AbstractNamespaceContext
namespaceURI
- URI of namespace to lookupCopyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.