org.apache.xml.serializer.dom3
Class NamespaceSupport

java.lang.Object
  extended by org.apache.xml.serializer.dom3.NamespaceSupport

public class NamespaceSupport
extends java.lang.Object

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. Derived from org.apache.xerces.util.NamespaceSupport


Nested Class Summary
protected  class NamespaceSupport.Prefixes
           
 
Field Summary
protected  int[] fContext
          Context indexes.
protected  int fCurrentContext
          The current context.
protected  java.lang.String[] fNamespace
          Namespace binding information.
protected  int fNamespaceSize
          The top of the namespace information array.
protected  java.lang.String[] fPrefixes
           
(package private) static java.lang.String PREFIX_XML
           
(package private) static java.lang.String PREFIX_XMLNS
           
static java.lang.String XML_URI
          The XML Namespace ("http://www.w3.org/XML/1998/namespace").
static java.lang.String XMLNS_URI
          XML Information Set REC all namespace attributes (including those named xmlns, whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/
 
Constructor Summary
NamespaceSupport()
          Default constructor.
 
Method Summary
 boolean declarePrefix(java.lang.String prefix, java.lang.String uri)
           
 java.util.Enumeration getAllPrefixes()
           
 java.lang.String getDeclaredPrefixAt(int index)
           
 int getDeclaredPrefixCount()
           
 java.lang.String getPrefix(java.lang.String uri)
           
 java.lang.String getURI(java.lang.String prefix)
           
 void popContext()
           
 void pushContext()
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX_XML

static final java.lang.String PREFIX_XML

PREFIX_XMLNS

static final java.lang.String PREFIX_XMLNS

XML_URI

public static final java.lang.String XML_URI
The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is the Namespace URI that is automatically mapped to the "xml" prefix.


XMLNS_URI

public static final java.lang.String XMLNS_URI
XML Information Set REC all namespace attributes (including those named xmlns, whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/


fNamespace

protected java.lang.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.

See Also:
fNamespaceSize, fContext

fNamespaceSize

protected int fNamespaceSize
The top of the namespace information array.


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.

See Also:
fNamespaceSize

fCurrentContext

protected int fCurrentContext
The current context.


fPrefixes

protected java.lang.String[] fPrefixes
Constructor Detail

NamespaceSupport

public NamespaceSupport()
Default constructor.

Method Detail

reset

public void reset()
See Also:
org.apache.xerces.xni.NamespaceContext#reset()

pushContext

public void pushContext()
See Also:
org.apache.xerces.xni.NamespaceContext#pushContext()

popContext

public void popContext()
See Also:
org.apache.xerces.xni.NamespaceContext#popContext()

declarePrefix

public boolean declarePrefix(java.lang.String prefix,
                             java.lang.String uri)
See Also:
org.apache.xerces.xni.NamespaceContext#declarePrefix(String, String)

getURI

public java.lang.String getURI(java.lang.String prefix)
See Also:
org.apache.xerces.xni.NamespaceContext#getURI(String)

getPrefix

public java.lang.String getPrefix(java.lang.String uri)
See Also:
org.apache.xerces.xni.NamespaceContext#getPrefix(String)

getDeclaredPrefixCount

public int getDeclaredPrefixCount()
See Also:
org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount()

getDeclaredPrefixAt

public java.lang.String getDeclaredPrefixAt(int index)
See Also:
org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int)

getAllPrefixes

public java.util.Enumeration getAllPrefixes()
See Also:
org.apache.xerces.xni.NamespaceContext#getAllPrefixes()