APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.xinclude

public Class MultipleScopeNamespaceSupport

extends NamespaceSupport
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xerces.internal.xinclude.XIncludeNamespaceSupport
Imports
com.sun.org.apache.xerces.internal.util.NamespaceSupport, .XMLSymbols, com.sun.org.apache.xerces.internal.xni.NamespaceContext, java.util.Enumeration

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.
Author
Peter McCracken, IBM

Field Summary

Modifier and TypeField and Description
protected int
protected int[]
Inherited from com.sun.org.apache.xerces.internal.util.NamespaceSupport:
fContextfCurrentContextfNamespacefNamespaceSizefPrefixes

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Enumeration<String>
getAllPrefixes()

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.getAllPrefixes.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getAllPrefixes.

Return an enumeration of all prefixes whose declarations are active in the current context.

public String
public String
getPrefix(String uri, int context)

public String
getPrefix(String uri, int start, int end)

public int
getScopeForContext(int context)

public String
getURI(String prefix)

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.getURI.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getURI.

Look up a prefix and get the currently-mapped Namespace URI.

public String
getURI(String prefix, int context)

public String
getURI(String prefix, int start, int end)

public void
popScope()

Pops the current scope.

public void
pushScope()

Begins a new scope.

public void
reset()

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.reset.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.reset.

Only resets the current scope -- all namespaces defined in lower scopes remain valid after a call to reset.

Inherited from com.sun.org.apache.xerces.internal.util.NamespaceSupport:
containsPrefixcontainsPrefixInCurrentContextdeclarePrefixgetDeclaredPrefixAtgetDeclaredPrefixCountgetPrefixesgetPrefixespopContextpushContext

Field Detail

fCurrentScopeback to summary
protected int fCurrentScope
fScopeback to summary
protected int[] fScope

Constructor Detail

MultipleScopeNamespaceSupportback to summary
public MultipleScopeNamespaceSupport()
MultipleScopeNamespaceSupportback to summary
public MultipleScopeNamespaceSupport(NamespaceContext context)

Method Detail

getAllPrefixesback to summary
public Enumeration<String> getAllPrefixes()

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.getAllPrefixes.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getAllPrefixes.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getAllPrefixes.

Return an enumeration of all prefixes whose declarations are active in the current context. This includes declarations from parent contexts that have not been overridden.

getPrefixback to summary
public String getPrefix(String uri)

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.getPrefix.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getPrefix.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getPrefix.

Look up a namespace URI and get one of the mapped prefix.

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).

getPrefixback to summary
public String getPrefix(String uri, int context)
getPrefixback to summary
public String getPrefix(String uri, int start, int end)
getScopeForContextback to summary
public int getScopeForContext(int context)
getURIback to summary
public String getURI(String prefix)

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.getURI.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getURI.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getURI.

Look up a prefix and get the currently-mapped Namespace URI.

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.

getURIback to summary
public String getURI(String prefix, int context)
getURIback to summary
public String getURI(String prefix, int start, int end)
popScopeback to summary
public void popScope()

Pops the current scope. The namespace bindings from the new current scope are then used for searching for namespaces and prefixes.

pushScopeback to summary
public void pushScope()

Begins a new scope. None of the previous namespace bindings will be used, until the new scope is popped with popScope()

resetback to summary
public void reset()

Overrides com.sun.org.apache.xerces.internal.util.NamespaceSupport.reset.

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.reset.

Only resets the current scope -- all namespaces defined in lower scopes remain valid after a call to reset.