|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xerces.util.NamespaceSupport
org.apache.xerces.xinclude.MultipleScopeNamespaceSupport
public class MultipleScopeNamespaceSupport
This implementation of NamespaceContext has the ability to maintain multiple scopes of namespace/prefix bindings. This is useful in situations when it is not always appropriate for elements to inherit the namespace bindings of their ancestors (such as included elements in XInclude). When searching for a URI to match a prefix, or a prefix to match a URI, it is searched for in the current context, then the ancestors of the current context, up to the beginning of the current scope. Other scopes are not searched.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.xerces.util.NamespaceSupport |
---|
NamespaceSupport.Prefixes |
Field Summary | |
---|---|
protected int |
fCurrentScope
|
protected int[] |
fScope
|
Fields inherited from class org.apache.xerces.util.NamespaceSupport |
---|
fContext, fCurrentContext, fNamespace, fNamespaceSize, fPrefixes |
Fields inherited from interface org.apache.xerces.xni.NamespaceContext |
---|
XML_URI, XMLNS_URI |
Constructor Summary | |
---|---|
MultipleScopeNamespaceSupport()
|
|
MultipleScopeNamespaceSupport(org.apache.xerces.xni.NamespaceContext context)
|
Method Summary | |
---|---|
java.util.Enumeration |
getAllPrefixes()
Return an enumeration of all prefixes whose declarations are active in the current context. |
java.lang.String |
getPrefix(java.lang.String uri)
Look up a namespace URI and get one of the mapped prefix. |
java.lang.String |
getPrefix(java.lang.String uri,
int context)
|
java.lang.String |
getPrefix(java.lang.String uri,
int start,
int end)
|
int |
getScopeForContext(int context)
|
java.lang.String |
getURI(java.lang.String prefix)
Look up a prefix and get the currently-mapped Namespace URI. |
java.lang.String |
getURI(java.lang.String prefix,
int context)
|
java.lang.String |
getURI(java.lang.String prefix,
int start,
int end)
|
void |
popScope()
Pops the current scope. |
void |
pushScope()
Begins a new scope. |
void |
reset()
Only resets the current scope -- all namespaces defined in lower scopes remain valid after a call to reset. |
Methods inherited from class org.apache.xerces.util.NamespaceSupport |
---|
containsPrefix, declarePrefix, getDeclaredPrefixAt, getDeclaredPrefixCount, popContext, pushContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] fScope
protected int fCurrentScope
Constructor Detail |
---|
public MultipleScopeNamespaceSupport()
public MultipleScopeNamespaceSupport(org.apache.xerces.xni.NamespaceContext context)
context
- Method Detail |
---|
public java.util.Enumeration getAllPrefixes()
org.apache.xerces.xni.NamespaceContext
getAllPrefixes
in interface org.apache.xerces.xni.NamespaceContext
getAllPrefixes
in class NamespaceSupport
NamespaceContext.getAllPrefixes()
public int getScopeForContext(int context)
public java.lang.String getPrefix(java.lang.String uri)
org.apache.xerces.xni.NamespaceContext
This method looks up the namespace URI in the current context. If more than one prefix is currently mapped to the same URI, this method will make an arbitrary selection If no mapping is found, this methods will continue lookup in the parent context(s).
getPrefix
in interface org.apache.xerces.xni.NamespaceContext
getPrefix
in class NamespaceSupport
uri
- The namespace URI to look up.
NamespaceContext.getPrefix(String)
public java.lang.String getURI(java.lang.String prefix)
org.apache.xerces.xni.NamespaceContext
This method looks up the prefix in the current context. If no mapping is found, this methods will continue lookup in the parent context(s). Use the empty string ("") for the default Namespace.
getURI
in interface org.apache.xerces.xni.NamespaceContext
getURI
in class NamespaceSupport
prefix
- The prefix to look up.
NamespaceContext.getURI(String)
public java.lang.String getPrefix(java.lang.String uri, int context)
public java.lang.String getURI(java.lang.String prefix, int context)
public java.lang.String getPrefix(java.lang.String uri, int start, int end)
public java.lang.String getURI(java.lang.String prefix, int start, int end)
public void reset()
reset
in interface org.apache.xerces.xni.NamespaceContext
reset
in class NamespaceSupport
NamespaceContext.reset()
public void pushScope()
public void popScope()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |