com.sun.xml.fastinfoset.sax
Class AttributesHolder

java.lang.Object
  extended by com.sun.xml.fastinfoset.sax.AttributesHolder
All Implemented Interfaces:
EncodingAlgorithmAttributes, org.xml.sax.Attributes

public class AttributesHolder
extends java.lang.Object
implements EncodingAlgorithmAttributes


Constructor Summary
AttributesHolder()
           
AttributesHolder(java.util.Map registeredEncodingAlgorithms)
           
 
Method Summary
 void addAttribute(QualifiedName name, java.lang.String value)
           
 void addAttributeWithAlgorithmData(QualifiedName name, java.lang.String URI, int id, java.lang.Object data)
           
 void clear()
           
 java.lang.Object getAlgorithmData(int index)
          Return the data of the encoding algorithm.
 int getAlgorithmIndex(int index)
          Return the index of the encoding algorithm.
 java.lang.String getAlgorithmURI(int index)
          Return the URI of the encoding algorithm.
 java.lang.String getAlpababet(int index)
          Return the alphabet associated with the attribute value.
 int getIndex(java.lang.String qName)
           
 int getIndex(java.lang.String uri, java.lang.String localName)
           
 int getLength()
           
 java.lang.String getLocalName(int index)
           
 java.lang.String getPrefix(int index)
           
 java.lang.String getQName(int index)
           
 QualifiedName getQualifiedName(int index)
           
 boolean getToIndex(int index)
          Return the whether the attribute value should be indexed or not.
 java.lang.String getType(int index)
           
 java.lang.String getType(java.lang.String qName)
           
 java.lang.String getType(java.lang.String uri, java.lang.String localName)
           
 java.lang.String getURI(int index)
           
 java.lang.String getValue(int index)
           
 java.lang.String getValue(java.lang.String qName)
           
 java.lang.String getValue(java.lang.String uri, java.lang.String localName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesHolder

public AttributesHolder()

AttributesHolder

public AttributesHolder(java.util.Map registeredEncodingAlgorithms)
Method Detail

getLength

public final int getLength()
Specified by:
getLength in interface org.xml.sax.Attributes

getLocalName

public final java.lang.String getLocalName(int index)
Specified by:
getLocalName in interface org.xml.sax.Attributes

getQName

public final java.lang.String getQName(int index)
Specified by:
getQName in interface org.xml.sax.Attributes

getType

public final java.lang.String getType(int index)
Specified by:
getType in interface org.xml.sax.Attributes

getURI

public final java.lang.String getURI(int index)
Specified by:
getURI in interface org.xml.sax.Attributes

getValue

public final java.lang.String getValue(int index)
Specified by:
getValue in interface org.xml.sax.Attributes

getIndex

public final int getIndex(java.lang.String qName)
Specified by:
getIndex in interface org.xml.sax.Attributes

getType

public final java.lang.String getType(java.lang.String qName)
Specified by:
getType in interface org.xml.sax.Attributes

getValue

public final java.lang.String getValue(java.lang.String qName)
Specified by:
getValue in interface org.xml.sax.Attributes

getIndex

public final int getIndex(java.lang.String uri,
                          java.lang.String localName)
Specified by:
getIndex in interface org.xml.sax.Attributes

getType

public final java.lang.String getType(java.lang.String uri,
                                      java.lang.String localName)
Specified by:
getType in interface org.xml.sax.Attributes

getValue

public final java.lang.String getValue(java.lang.String uri,
                                       java.lang.String localName)
Specified by:
getValue in interface org.xml.sax.Attributes

clear

public final void clear()

getAlgorithmURI

public final java.lang.String getAlgorithmURI(int index)
Description copied from interface: EncodingAlgorithmAttributes
Return the URI of the encoding algorithm.

If the algorithm data corresponds to a built-in encoding algorithm then the null is returned.

If the algorithm data corresponds to an application-defined encoding algorithm then the URI of the algorithm is returned.

If EncodingAlgorithmAttributes.getAlgorithmData(int) returns null then the result of this method is undefined.

Specified by:
getAlgorithmURI in interface EncodingAlgorithmAttributes
Parameters:
index - The attribute index (zero-based).
Returns:
The URI. If the index is out of range then null is returned.

getAlgorithmIndex

public final int getAlgorithmIndex(int index)
Description copied from interface: EncodingAlgorithmAttributes
Return the index of the encoding algorithm.

If EncodingAlgorithmAttributes.getAlgorithmData(int) returns null then the result of this method is undefined.

Specified by:
getAlgorithmIndex in interface EncodingAlgorithmAttributes
Parameters:
index - The attribute index (zero-based).
Returns:
The algorithm index. If index is out of range then -1 is returned.
See Also:
EncodingAlgorithmIndexes

getAlgorithmData

public final java.lang.Object getAlgorithmData(int index)
Description copied from interface: EncodingAlgorithmAttributes
Return the data of the encoding algorithm.

If the algorithm data corresponds to a built-in encoding algorithm then an Object corresponding to the Java primitive type is returned.

If the algorithm data corresponds to an application-defined encoding algorithm then an Object that is an instance of byte[] is returned if there is no EncodingAlgorithm registered for the application-defined encoding algorithm URI. Otherwise, an Object produced from the registeredEncodingAlgorithm is returned.

If there no encoding algorithm data associated an attribute then null is returned.

Specified by:
getAlgorithmData in interface EncodingAlgorithmAttributes
Parameters:
index - The attribute index (zero-based).
Returns:
The data. If the index is out of range then null is returned.

getAlpababet

public java.lang.String getAlpababet(int index)
Description copied from interface: EncodingAlgorithmAttributes
Return the alphabet associated with the attribute value.

Specified by:
getAlpababet in interface EncodingAlgorithmAttributes
Parameters:
index - The attribute index (zero-based).
Returns:
The alphabet. If the index is out of range then null is returned. If there is is no alphabet then null is returned.

getToIndex

public boolean getToIndex(int index)
Description copied from interface: EncodingAlgorithmAttributes
Return the whether the attribute value should be indexed or not.

Specified by:
getToIndex in interface EncodingAlgorithmAttributes
Parameters:
index - The attribute index (zero-based).
Returns:
True if attribute value should be indexed, otherwise false.

addAttribute

public final void addAttribute(QualifiedName name,
                               java.lang.String value)

addAttributeWithAlgorithmData

public final void addAttributeWithAlgorithmData(QualifiedName name,
                                                java.lang.String URI,
                                                int id,
                                                java.lang.Object data)

getQualifiedName

public final QualifiedName getQualifiedName(int index)

getPrefix

public final java.lang.String getPrefix(int index)