org.apache.xalan.xsltc.runtime
Class AttributeList

java.lang.Object
  extended byorg.apache.xalan.xsltc.runtime.AttributeList
All Implemented Interfaces:
Attributes

public class AttributeList
extends Object
implements Attributes

Author:
Morten Jorgensen

Constructor Summary
AttributeList()
          AttributeList constructor
AttributeList(Attributes attributes)
          Attributes clone constructor
 
Method Summary
 void add(String qname, String value)
          Adds an attribute to the list
 void clear()
          Clears the attribute list
 int getIndex(String qname)
          SAX2: Look up the index of an attribute by XML 1.0 qualified name.
 int getIndex(String namespaceURI, String localPart)
          SAX2: Look up the index of an attribute by Namespace name.
 int getLength()
          SAX2: Return the number of attributes in the list.
 String getLocalName(int index)
          SAX2: Look up an attribute's local name by index.
 String getQName(int pos)
          Return the name of an attribute in this list (by position).
 String getType(int index)
          SAX2: Look up an attribute's type by index.
 String getType(String qname)
          SAX2: Look up an attribute's type by qname.
 String getType(String uri, String localName)
          SAX2: Look up an attribute's type by Namespace name.
 String getURI(int index)
          SAX2: Look up an attribute's Namespace URI by index.
 String getValue(int pos)
          SAX2: Look up an attribute's value by index.
 String getValue(String qname)
          SAX2: Look up an attribute's value by qname.
 String getValue(String uri, String localName)
          SAX2: Look up an attribute's value by Namespace name - SLOW!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeList

public AttributeList()
AttributeList constructor


AttributeList

public AttributeList(Attributes attributes)
Attributes clone constructor

Method Detail

getLength

public int getLength()
SAX2: Return the number of attributes in the list.

Specified by:
getLength in interface Attributes
Returns:
The number of attributes in the list.
See Also:
Attributes.getURI(int), Attributes.getLocalName(int), Attributes.getQName(int), Attributes.getType(int), Attributes.getValue(int)

getURI

public String getURI(int index)
SAX2: Look up an attribute's Namespace URI by index.

Specified by:
getURI in interface Attributes
Parameters:
index - The attribute index (zero-based).
Returns:
The Namespace URI, or the empty string if none is available, or null if the index is out of range.
See Also:
Attributes.getLength()

getLocalName

public String getLocalName(int index)
SAX2: Look up an attribute's local name by index.

Specified by:
getLocalName in interface Attributes
Parameters:
index - The attribute index (zero-based).
Returns:
The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range.
See Also:
Attributes.getLength()

getQName

public String getQName(int pos)
Return the name of an attribute in this list (by position).

Specified by:
getQName in interface Attributes
Parameters:
pos - The attribute index (zero-based).
Returns:
The XML 1.0 qualified name, or the empty string if none is available, or null if the index is out of range.
See Also:
Attributes.getLength()

getType

public String getType(int index)
SAX2: Look up an attribute's type by index.

Specified by:
getType in interface Attributes
Parameters:
index - The attribute index (zero-based).
Returns:
The attribute's type as a string, or null if the index is out of range.
See Also:
Attributes.getLength()

getIndex

public int getIndex(String namespaceURI,
                    String localPart)
SAX2: Look up the index of an attribute by Namespace name.

Specified by:
getIndex in interface Attributes
Parameters:
namespaceURI - The Namespace URI, or the empty string if the name has no Namespace URI.
localPart - The attribute's local name.
Returns:
The index of the attribute, or -1 if it does not appear in the list.

getIndex

public int getIndex(String qname)
SAX2: Look up the index of an attribute by XML 1.0 qualified name.

Specified by:
getIndex in interface Attributes
Parameters:
qname - The qualified (prefixed) name.
Returns:
The index of the attribute, or -1 if it does not appear in the list.

getType

public String getType(String uri,
                      String localName)
SAX2: Look up an attribute's type by Namespace name.

Specified by:
getType in interface Attributes
Parameters:
uri - The Namespace URI, or the empty String if the name has no Namespace URI.
localName - The local name of the attribute.
Returns:
The attribute type as a string, or null if the attribute is not in the list or if Namespace processing is not being performed.

getType

public String getType(String qname)
SAX2: Look up an attribute's type by qname.

Specified by:
getType in interface Attributes
Parameters:
qname - The XML 1.0 qualified name.
Returns:
The attribute type as a string, or null if the attribute is not in the list or if qualified names are not available.

getValue

public String getValue(int pos)
SAX2: Look up an attribute's value by index.

Specified by:
getValue in interface Attributes
Parameters:
pos - The attribute index (zero-based).
Returns:
The attribute's value as a string, or null if the index is out of range.
See Also:
Attributes.getLength()

getValue

public String getValue(String qname)
SAX2: Look up an attribute's value by qname.

Specified by:
getValue in interface Attributes
Parameters:
qname - The XML 1.0 qualified name.
Returns:
The attribute value as a string, or null if the attribute is not in the list or if qualified names are not available.

getValue

public String getValue(String uri,
                       String localName)
SAX2: Look up an attribute's value by Namespace name - SLOW!

Specified by:
getValue in interface Attributes
Parameters:
uri - The Namespace URI, or the empty String if the name has no Namespace URI.
localName - The local name of the attribute.
Returns:
The attribute value as a string, or null if the attribute is not in the list.

add

public void add(String qname,
                String value)
Adds an attribute to the list


clear

public void clear()
Clears the attribute list



Copyright ? 2004 Apache XML Project. All Rights Reserved.