|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents a list of XML attributes.
It is a more generic version of org.xml.sax.Attributes
with
the String
type replaced by CharSequence
.
Note: To parse primitive types attributes (e.g. int, long, double), the
use of the TypeFormat
class is
recommended (faster and avoids memory allocation).
Method Summary | |
int |
getIndex(java.lang.CharSequence qName)
Looks up the index of an attribute by XML 1.0 qualified name. |
int |
getIndex(java.lang.CharSequence uri,
java.lang.CharSequence localName)
Looks up the index of an attribute by Namespace name. |
int |
getLength()
Returns the number of attributes in this list of attributes. |
java.lang.CharSequence |
getLocalName(int index)
Looks up an attribute's local name by index. |
java.lang.CharSequence |
getQName(int index)
Looks up an attribute's XML 1.0 qualified name by index. |
java.lang.String |
getType(java.lang.CharSequence qName)
Looks up an attribute's type by XML 1.0 qualified name. |
java.lang.String |
getType(java.lang.CharSequence uri,
java.lang.CharSequence localName)
Looks up an attribute's type by Namespace name. |
java.lang.String |
getType(int index)
Looks up an attribute's type by index. |
java.lang.CharSequence |
getURI(int index)
Looks up an attribute's Namespace URI by index. |
java.lang.CharSequence |
getValue(java.lang.CharSequence qName)
Looks up an attribute's value by XML 1.0 qualified name. |
java.lang.CharSequence |
getValue(java.lang.CharSequence uri,
java.lang.CharSequence localName)
Looks up an attribute's value by Namespace name. |
java.lang.CharSequence |
getValue(int index)
Looks up an attribute's value by index. |
Method Detail |
public int getLength()
public java.lang.CharSequence getURI(int index)
index
- the attribute index (zero-based).
null
if the index is out of range.getLength()
public java.lang.CharSequence getLocalName(int index)
index
- the attribute index (zero-based).
null
if
the index is out of range.getLength()
public java.lang.CharSequence getQName(int index)
index
- the attribute index (zero-based).
null
if the index is out
of range.getLength()
public java.lang.String getType(int index)
The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).
If the parser has not read a declaration for the attribute, or if the parser does not report attribute types, then it must return the value "CDATA" as stated in the XML 1.0 Recommentation (clause 3.3.3, "Attribute-Value Normalization").
For an enumerated attribute that is not a notation, the parser will report the type as "NMTOKEN".
index
- the attribute index (zero-based).
getLength()
public java.lang.CharSequence getValue(int index)
If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string with each token separated by a single space.
index
- the attribute index (zero-based).
null
if the index is out of range.getLength()
public int getIndex(java.lang.CharSequence uri, java.lang.CharSequence localName)
uri
- the Namespace URI, or an empty character sequence if
the name has no Namespace URI.localName
- the attribute's local name.
-1
if it does not
appear in the list.public int getIndex(java.lang.CharSequence qName)
qName
- the qualified (prefixed) name.
-1
if it does not
appear in the list.public java.lang.String getType(java.lang.CharSequence uri, java.lang.CharSequence localName)
See getType(int)
for a description
of the possible types.
uri
- the Namespace URI, or an empty character sequence if the
name has no Namespace URI.localName
- the local name of the attribute.
public java.lang.String getType(java.lang.CharSequence qName)
See getType(int)
for a description
of the possible types.
qName
- The XML 1.0 qualified name.
public java.lang.CharSequence getValue(java.lang.CharSequence uri, java.lang.CharSequence localName)
See getValue(int)
for a description
of the possible values.
uri
- the Namespace URI, or the empty character sequence if the
name has no Namespace URI.localName
- the local name of the attribute.
null
if the attribute is not in the list.public java.lang.CharSequence getValue(java.lang.CharSequence qName)
See getValue(int)
for a description
of the possible values.
qName
- The XML 1.0 qualified name.
null
if the attribute is not in the list or if qualified names
are not available.
|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |