|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.AttributeCollection
AttributeCollection is an implementation of the SAX interface AttributeList that also provides the ability to manipulate namespaces and to convert attributes into Nodes. It is extremely similar (both in interface and in implementation) to the SAX2 Attributes class, but was defined before SAX2 was available.
Constructor Summary | |
AttributeCollection()
Create an empty attribute list. |
|
AttributeCollection(int n)
Create an empty attribute list with space for n attributes |
Method Summary | |
void |
addAttribute(Name name,
java.lang.String type,
java.lang.String value)
Add an attribute to an attribute list. |
void |
addAttribute(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName,
java.lang.String type,
java.lang.String value)
Add an attribute to an attribute list. |
void |
clear()
Clear the attribute list. |
void |
compact()
Compact the attribute list to avoid wasting memory |
AttributeCollection |
copy()
Create a new attribute collection as a clone of this one |
Name |
getExpandedName(int i)
Get the name of an attribute (by position). |
int |
getLength()
Return the number of attributes in the list. |
java.lang.String |
getName(int i)
Get the name of an attribute (by position). |
int |
getPosition(Name name)
Find the position of an attribute with a given name |
java.lang.String |
getType(int i)
Get the type of an attribute (by position). |
java.lang.String |
getType(java.lang.String name)
Get the type of an attribute (by name). |
java.lang.String |
getValue(int i)
Get the value of an attribute (by position). |
java.lang.String |
getValue(Name name)
Get the value of an attribute, given its full name. |
java.lang.String |
getValue(java.lang.String name)
Get the value of an attribute (by name). |
void |
removeAttribute(Name name)
Remove an attribute from the list. |
void |
setAttribute(Name name,
java.lang.String value)
Set an attribute value |
void |
setAttribute(Name name,
java.lang.String type,
java.lang.String value)
Set an attribute value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AttributeCollection()
public AttributeCollection(int n)
Method Detail |
public AttributeCollection copy()
public void addAttribute(Name name, java.lang.String type, java.lang.String value)
name
- The attribute name.type
- The attribute type ("NMTOKEN" for an enumeration).value
- The attribute value (must not be null).removeAttribute(com.icl.saxon.om.Name)
,
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void addAttribute(java.lang.String prefix, java.lang.String uri, java.lang.String localName, java.lang.String type, java.lang.String value)
prefix
- The namespace prefix of the attribute name.uri
- The namespace uri of the attribute name.localname
- The local part of the attribute name.type
- The attribute type (e.g. "NMTOKEN").value
- The attribute value (must not be null).removeAttribute(com.icl.saxon.om.Name)
,
DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void removeAttribute(Name name)
name
- The attribute name.public void setAttribute(Name name, java.lang.String value)
name
- the name of the attributevalue
- the value of the attributepublic void setAttribute(Name name, java.lang.String type, java.lang.String value)
name
- the name of the attributetype
- the type of the attribute (e.g. CDATA)value
- the value of the attributepublic void clear()
public void compact()
public int getLength()
getLength
in interface org.xml.sax.AttributeList
public java.lang.String getName(int i)
getName
in interface org.xml.sax.AttributeList
i
- The position of the attribute in the list.public java.lang.String getType(int i)
getType
in interface org.xml.sax.AttributeList
i
- The position of the attribute in the list.public java.lang.String getValue(int i)
getValue
in interface org.xml.sax.AttributeList
i
- The position of the attribute in the list.public java.lang.String getType(java.lang.String name)
getType
in interface org.xml.sax.AttributeList
name
- The display name of the attribute.public java.lang.String getValue(java.lang.String name)
getValue
in interface org.xml.sax.AttributeList
name
- The attribute name.public Name getExpandedName(int i)
i
- The position of the attribute in the list.public java.lang.String getValue(Name name)
name
- The full name of the attribute in the list.public int getPosition(Name name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |