Package org.exolab.adaptx.xml
Class AttributeListImpl
- java.lang.Object
-
- org.exolab.adaptx.xml.AttributeListImpl
-
- All Implemented Interfaces:
org.xml.sax.AttributeList
public class AttributeListImpl extends java.lang.Object implements org.xml.sax.AttributeList
my own implementation of the SAX AttributeList- Version:
- $Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
-
-
Constructor Summary
Constructors Constructor Description AttributeListImpl()
AttributeListImpl(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(java.lang.String name, java.lang.String value)
void
clear()
Removes all attribute mappings from this AttributeListint
getLength()
Returns the number of attributes in the list.java.lang.String
getName(int i)
Returns the name of the attribute at the given index.java.lang.String
getType(int i)
Returns the type of the attribute at the specified index.java.lang.String
getType(java.lang.String name)
Return the type of the attribute with the given name.java.lang.String
getValue(int i)
Return the value of the attribute at the specified indexjava.lang.String
getValue(java.lang.String name)
Get the value of an attribute (by name).void
remove(int index)
Removes the name-value pair at the given indexvoid
remove(java.lang.String name)
Removes the name and it's associated value from this AttributeList
-
-
-
Method Detail
-
addAttribute
public void addAttribute(java.lang.String name, java.lang.String value)
-
clear
public void clear()
Removes all attribute mappings from this AttributeList
-
remove
public void remove(int index)
Removes the name-value pair at the given index- Parameters:
index
- the index to remove the name value pair from
-
remove
public void remove(java.lang.String name)
Removes the name and it's associated value from this AttributeList- Parameters:
the
- name of the attribute mapping to remove
-
getLength
public int getLength()
Returns the number of attributes in the list.- Specified by:
getLength
in interfaceorg.xml.sax.AttributeList
- Returns:
- The number of attributes in the list.
-
getName
public java.lang.String getName(int i)
Returns the name of the attribute at the given index.- Specified by:
getName
in interfaceorg.xml.sax.AttributeList
- Parameters:
i
- The position of the attribute in the list.- Returns:
- The attribute name as a string, or null if there is no attribute at that position.
-
getType
public java.lang.String getType(int i)
Returns the type of the attribute at the specified index.- Specified by:
getType
in interfaceorg.xml.sax.AttributeList
- Parameters:
i
- The position of the attribute in the list.- Returns:
- The attribute type as a string ("NMTOKEN" for an
enumeration, and "CDATA" if no declaration was
read), or null if there is no attribute at
that position.
Note: Not supported, will simply return null.
-
getValue
public java.lang.String getValue(int i)
Return the value of the attribute at the specified index- Specified by:
getValue
in interfaceorg.xml.sax.AttributeList
- Parameters:
i
- The position of the attribute in the list.- Returns:
- The attribute value as a string, or null if there is no attribute at that position.
-
getType
public java.lang.String getType(java.lang.String name)
Return the type of the attribute with the given name.- Specified by:
getType
in interfaceorg.xml.sax.AttributeList
- Parameters:
name
- The attribute name.- Returns:
- The attribute type as a string ("NMTOKEN" for an
enumeration, and "CDATA" if no declaration was
read).
Note: Not supported, will simply return null.
-
getValue
public java.lang.String getValue(java.lang.String name)
Get the value of an attribute (by name).- Specified by:
getValue
in interfaceorg.xml.sax.AttributeList
- Parameters:
name
- The attribute name.- See Also:
AttributeList.getValue(java.lang.String)
-
-