|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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,
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,
String type,
String value)
Add an attribute to an attribute list. |
void |
addAttribute(String prefix,
String uri,
String localName,
String type,
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(String name)
Get the index of an attribute (by name). |
int |
getIndex(String uri,
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. |
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). |
String |
getQName(int index)
Get the display name of an attribute (by position). |
String |
getType(int index)
Get the type of an attribute (by position). |
String |
getType(String name)
Get the type of an attribute (by name). |
String |
getType(String uri,
String localname)
Get the type of an attribute (by name). |
String |
getURI(int index)
Get the namespace URI of an attribute (by position). |
String |
getValue(int index)
Get the value of an attribute (by position). |
String |
getValue(String name)
Get the value of an attribute (by name). |
String |
getValue(String uri,
String localname)
Get the value of an attribute (by name). |
String |
getValueByFingerprint(int fingerprint)
Get the attribute value using its fingerprint |
void |
setAttribute(int nameCode,
String type,
String value)
Set an attribute value |
void |
setAttribute(String prefix,
String uri,
String localName,
String type,
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, Attributes atts)
Method Detail |
public void addAttribute(int nameCode, String type, 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(String prefix, String uri, String localName, String type, 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(String prefix, String uri, String localName, String type, String value)
type
- the type of the attribute (e.g. CDATA)value
- the value of the attributepublic void setAttribute(int nameCode, String type, 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 Attributes
public int getNameCode(int index)
public String getQName(int index)
getQName
in interface Attributes
public String getLocalName(int index)
getLocalName
in interface Attributes
public String getURI(int index)
getURI
in interface Attributes
index
- The position of the attribute in the list.
public String getType(int index)
getType
in interface Attributes
index
- The position of the attribute in the list.
public String getType(String uri, String localname)
getType
in interface Attributes
uri
- The namespace uri of the attribute.localname
- The local name of the attribute.
public String getValue(int index)
getValue
in interface Attributes
index
- The position of the attribute in the list.
public String getValue(String uri, String localname)
getValue
in interface Attributes
uri
- The namespace uri of the attribute.localname
- The local name of the attribute.
public String getValueByFingerprint(int fingerprint)
public int getIndex(String name)
getIndex
in interface Attributes
name
- The display name of the attribute.
public int getIndex(String uri, String localname)
getIndex
in interface Attributes
uri
- The namespace uri of the attribute.localname
- The local name of the attribute.
public int getIndexByFingerprint(int fingerprint)
public String getType(String name)
getType
in interface Attributes
name
- The display name of the attribute.
public String getValue(String name)
getValue
in interface Attributes
name
- The attribute name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |