org.apache.xerces.util
Class NamespaceSupport
java.lang.Object
org.apache.xerces.util.NamespaceSupport
- org.apache.xerces.xni.NamespaceContext
public class NamespaceSupport
extends java.lang.Object
implements org.apache.xerces.xni.NamespaceContext
Namespace support for XML document handlers. This class doesn't
perform any error checking and assumes that all strings passed
as arguments to methods are unique symbols. The SymbolTable class
can be used for this purpose.
$Id: NamespaceSupport.java,v 1.20 2005/06/23 05:39:17 mrglavas Exp $
NamespaceSupport() - Default constructor.
|
NamespaceSupport(org.apache.xerces.xni.NamespaceContext context) - Constructs a namespace context object and initializes it with
the prefixes declared in the specified context.
|
fContext
protected int[] fContext
Context indexes. This array contains indexes into the namespace
information array. The index at the current context is the start
index of declared namespace bindings and runs to the size of the
namespace information array.
fCurrentContext
protected int fCurrentContext
The current context.
fNamespace
protected String[] fNamespace
Namespace binding information. This array is composed of a
series of tuples containing the namespace binding information:
<prefix, uri>. The default size can be set to anything
as long as it is a power of 2 greater than 1.
fNamespaceSize
protected int fNamespaceSize
The top of the namespace information array.
fPrefixes
protected String[] fPrefixes
NamespaceSupport
public NamespaceSupport()
Default constructor.
NamespaceSupport
public NamespaceSupport(org.apache.xerces.xni.NamespaceContext context)
Constructs a namespace context object and initializes it with
the prefixes declared in the specified context.
containsPrefix
public boolean containsPrefix(String prefix)
Checks whether a binding or unbinding for
the given prefix exists in the context.
prefix
- The prefix to look up.
- true if the given prefix exists in the context
declarePrefix
public boolean declarePrefix(String prefix,
String uri)
- declarePrefix in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.declarePrefix(String, String)
getAllPrefixes
public Enumeration getAllPrefixes()
- getAllPrefixes in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.getAllPrefixes()
getDeclaredPrefixAt
public String getDeclaredPrefixAt(int index)
- getDeclaredPrefixAt in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.getDeclaredPrefixAt(int)
getDeclaredPrefixCount
public int getDeclaredPrefixCount()
- getDeclaredPrefixCount in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.getDeclaredPrefixCount()
getPrefix
public String getPrefix(String uri)
- getPrefix in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.getPrefix(String)
getURI
public String getURI(String prefix)
- getURI in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.getURI(String)
popContext
public void popContext()
- popContext in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.popContext()
pushContext
public void pushContext()
- pushContext in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.pushContext()
reset
public void reset()
- reset in interface org.apache.xerces.xni.NamespaceContext
org.apache.xerces.xni.NamespaceContext.reset()
Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.