|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.icl.saxon.tree.AttributeCollection
AttributeCollection is an implementation of the SAX2 interface Attributes 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(AttributeCollection atts)
Create a new attribute collection as a clone |
|
AttributeCollection(NamePool pool)
Create an empty attribute list. |
|
AttributeCollection(NamePool pool,
org.xml.sax.Attributes atts)
Create a new attribute collection as a clone |
|
AttributeCollection(NamePool pool,
int n)
Create an empty attribute list with space for n attributes |
Method Summary | |
void |
addAttribute(int nameCode,
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 |
int |
getIndex(java.lang.String name)
Get the index of an attribute (by name). |
int |
getIndex(java.lang.String uri,
java.lang.String localname)
Get the index of an attribute (by name). |
int |
getIndexByFingerprint(int fingerprint)
Get the index, given the fingerprint |
int |
getLength()
Return the number of attributes in the list. |
java.lang.String |
getLocalName(int index)
Get the local name of an attribute (by position). |
int |
getNameCode(int index)
Get the namecode of an attribute (by position). |
java.lang.String |
getQName(int index)
Get the display name of an attribute (by position). |
java.lang.String |
getType(int index)
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 |
getType(java.lang.String uri,
java.lang.String localname)
Get the type of an attribute (by name). |
java.lang.String |
getURI(int index)
Get the namespace URI of an attribute (by position). |
java.lang.String |
getValue(int index)
Get the value of an attribute (by position). |
java.lang.String |
getValue(java.lang.String name)
Get the value of an attribute (by name). |
java.lang.String |
getValue(java.lang.String uri,
java.lang.String localname)
Get the value of an attribute (by name). |
java.lang.String |
getValueByFingerprint(int fingerprint)
Get the attribute value using its fingerprint |
void |
setAttribute(int nameCode,
java.lang.String type,
java.lang.String value)
Set an attribute value |
void |
setAttribute(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName,
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(NamePool pool)
public AttributeCollection(NamePool pool, int n)
public AttributeCollection(AttributeCollection atts)
public AttributeCollection(NamePool pool, org.xml.sax.Attributes atts)
Method Detail |
public void addAttribute(int nameCode, java.lang.String type, java.lang.String value)
type
- The attribute type ("NMTOKEN" for an enumeration).value
- The attribute value (must not be null).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.type
- The attribute type (e.g. "NMTOKEN").value
- The attribute value (must not be null).DocumentHandler.startElement(java.lang.String, org.xml.sax.AttributeList)
public void setAttribute(java.lang.String prefix, java.lang.String uri, java.lang.String localName, java.lang.String type, java.lang.String value)
type
- the type of the attribute (e.g. CDATA)value
- the value of the attributepublic void setAttribute(int nameCode, java.lang.String type, java.lang.String value)
type
- 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.Attributes
public int getNameCode(int index)
public java.lang.String getQName(int index)
getQName
in interface org.xml.sax.Attributes
public java.lang.String getLocalName(int index)
getLocalName
in interface org.xml.sax.Attributes
public java.lang.String getURI(int index)
getURI
in interface org.xml.sax.Attributes
index
- The position of the attribute in the list.
public java.lang.String getType(int index)
getType
in interface org.xml.sax.Attributes
index
- The position of the attribute in the list.
public java.lang.String getType(java.lang.String uri, java.lang.String localname)
getType
in interface org.xml.sax.Attributes
uri
- The namespace uri of the attribute.localname
- The local name of the attribute.
public java.lang.String getValue(int index)
getValue
in interface org.xml.sax.Attributes
index
- The position of the attribute in the list.
public java.lang.String getValue(java.lang.String uri, java.lang.String localname)
getValue
in interface org.xml.sax.Attributes
uri
- The namespace uri of the attribute.localname
- The local name of the attribute.
public java.lang.String getValueByFingerprint(int fingerprint)
public int getIndex(java.lang.String name)
getIndex
in interface org.xml.sax.Attributes
name
- The display name of the attribute.
public int getIndex(java.lang.String uri, java.lang.String localname)
getIndex
in interface org.xml.sax.Attributes
uri
- The namespace uri of the attribute.localname
- The local name of the attribute.
public int getIndexByFingerprint(int fingerprint)
public java.lang.String getType(java.lang.String name)
getType
in interface org.xml.sax.Attributes
name
- The display name of the attribute.
public java.lang.String getValue(java.lang.String name)
getValue
in interface org.xml.sax.Attributes
name
- The attribute name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |