Methods Summary |
---|
public int | getIndex(java.lang.String qName)Look up the index of an attribute by XML 1.0 qualified name.
char len = mLength;
char idx = 0;
while (idx < len) {
if (getQName(idx).equals(qName))
return idx;
idx++;
}
return -1;
|
public int | getIndex(java.lang.String uri, java.lang.String localName)Look up the index of an attribute by Namespace name.
char len = mLength;
char idx = 0;
while (idx < len) {
if ((mItems[idx << 3]).equals(uri) &&
mItems[(idx << 3) + 2].equals(localName))
return idx;
idx++;
}
return -1;
|
public int | getLength()Return the number of attributes in the list.
Once you know the number of attributes, you can iterate
through the list.
return mLength;
|
public java.lang.String | getLocalName(int index)Look up an attribute's local name by index.
return ((index >= 0) && (index < mLength))?
(mItems[(index << 3) + 2]):
null;
|
public java.lang.String | getQName(int index)Look up an attribute's XML 1.0 qualified name by index.
if ((index < 0) || (index >= mLength))
return null;
return mItems[(index << 3) + 1];
|
public java.lang.String | getType(java.lang.String uri, java.lang.String localName)Look up an attribute's type by Namespace name.
See {@link #getType(int) getType(int)} for a description
of the possible types.
int idx = getIndex(uri, localName);
return (idx >= 0)? (mItems[(idx << 3) + 4]): null;
|
public java.lang.String | getType(java.lang.String qName)Look up an attribute's type by XML 1.0 qualified name.
See {@link #getType(int) getType(int)} for a description
of the possible types.
int idx = getIndex(qName);
return (idx >= 0)? (mItems[(idx << 3) + 4]): null;
|
public java.lang.String | getType(int index)Look up an attribute's type by 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".
return ((index >= 0) && (index < (mItems.length >> 3)))?
(mItems[(index << 3) + 4]):
null;
|
public java.lang.String | getURI(int index)Look up an attribute's Namespace URI by index.
return ((index >= 0) && (index < mLength))?
(mItems[index << 3]):
null;
|
public java.lang.String | getValue(java.lang.String uri, java.lang.String localName)Look up an attribute's value by Namespace name.
See {@link #getValue(int) getValue(int)} for a description
of the possible values.
int idx = getIndex(uri, localName);
return (idx >= 0)? (mItems[(idx << 3) + 3]): null;
|
public java.lang.String | getValue(java.lang.String qName)Look up an attribute's value by XML 1.0 qualified name.
See {@link #getValue(int) getValue(int)} for a description
of the possible values.
int idx = getIndex(qName);
return (idx >= 0)? (mItems[(idx << 3) + 3]): null;
|
public java.lang.String | getValue(int index)Look up an attribute's value by 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.
return ((index >= 0) && (index < mLength))?
(mItems[(index << 3) + 3]):
null;
|
void | setLength(char length)Sets up the number of attributes and ensure the capacity of
the attribute string array.
if (length > ((char)(mItems.length >> 3))) {
mItems = new String[length << 3];
}
mLength = length;
|