|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xerces.util.AttributesProxy
public final class AttributesProxy
Wraps XMLAttributes
and makes it look like
AttributeList
and Attributes2
.
Constructor Summary | |
---|---|
AttributesProxy(XMLAttributes attributes)
|
Method Summary | |
---|---|
XMLAttributes |
getAttributes()
|
int |
getIndex(java.lang.String qName)
Look up the index of an attribute by XML qualified (prefixed) name. |
int |
getIndex(java.lang.String uri,
java.lang.String localPart)
Look up the index of an attribute by Namespace name. |
int |
getLength()
Return the number of attributes in this list. |
java.lang.String |
getLocalName(int index)
Look up an attribute's local name by index. |
java.lang.String |
getName(int i)
Return the name of an attribute in this list (by position). |
java.lang.String |
getQName(int index)
Look up an attribute's XML qualified (prefixed) name by index. |
java.lang.String |
getType(int i)
Return the type of an attribute in the list (by position). |
java.lang.String |
getType(java.lang.String name)
Return the type of an attribute in the list (by name). |
java.lang.String |
getType(java.lang.String uri,
java.lang.String localName)
Look up an attribute's type by Namespace name. |
java.lang.String |
getURI(int index)
Look up an attribute's Namespace URI by index. |
java.lang.String |
getValue(int i)
Return the value of an attribute in the list (by position). |
java.lang.String |
getValue(java.lang.String name)
Return the value of an attribute in the list (by name). |
java.lang.String |
getValue(java.lang.String uri,
java.lang.String localName)
Look up an attribute's value by Namespace name. |
boolean |
isDeclared(int index)
Returns false unless the attribute was declared in the DTD. |
boolean |
isDeclared(java.lang.String qName)
Returns false unless the attribute was declared in the DTD. |
boolean |
isDeclared(java.lang.String uri,
java.lang.String localName)
Returns false unless the attribute was declared in the DTD. |
boolean |
isSpecified(int index)
Returns true unless the attribute value was provided by DTD defaulting. |
boolean |
isSpecified(java.lang.String qName)
Returns true unless the attribute value was provided by DTD defaulting. |
boolean |
isSpecified(java.lang.String uri,
java.lang.String localName)
Returns true unless the attribute value was provided by DTD defaulting. |
void |
setAttributes(XMLAttributes attributes)
Sets the XML attributes to be wrapped. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributesProxy(XMLAttributes attributes)
Method Detail |
---|
public void setAttributes(XMLAttributes attributes)
public XMLAttributes getAttributes()
public int getLength()
AttributeList
The SAX parser may provide attributes in any arbitrary order, regardless of the order in which they were declared or specified. The number of attributes may be zero.
getLength
in interface AttributeList
getLength
in interface Attributes
Attributes.getURI(int)
,
Attributes.getLocalName(int)
,
Attributes.getQName(int)
,
Attributes.getType(int)
,
Attributes.getValue(int)
public java.lang.String getQName(int index)
Attributes
getQName
in interface Attributes
index
- The attribute index (zero-based).
Attributes.getLength()
public java.lang.String getURI(int index)
Attributes
getURI
in interface Attributes
index
- The attribute index (zero-based).
Attributes.getLength()
public java.lang.String getLocalName(int index)
Attributes
getLocalName
in interface Attributes
index
- The attribute index (zero-based).
Attributes.getLength()
public java.lang.String getType(int i)
AttributeList
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".
getType
in interface AttributeList
getType
in interface Attributes
i
- The index of the attribute in the list (starting at 0).
AttributeList.getLength()
,
AttributeList.getType(java.lang.String)
public java.lang.String getType(java.lang.String name)
AttributeList
The return value is the same as the return value for getType(int).
If the attribute name has a namespace prefix in the document, the application must include the prefix here.
getType
in interface AttributeList
getType
in interface Attributes
name
- The name of the attribute.
AttributeList.getType(int)
public java.lang.String getType(java.lang.String uri, java.lang.String localName)
Attributes
See getType(int)
for a description
of the possible types.
getType
in interface Attributes
uri
- The Namespace URI, or the empty String if the
name has no Namespace URI.localName
- The local name of the attribute.
public java.lang.String getValue(int i)
AttributeList
If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string separated by whitespace.
getValue
in interface AttributeList
getValue
in interface Attributes
i
- The index of the attribute in the list (starting at 0).
AttributeList.getLength()
,
AttributeList.getValue(java.lang.String)
public java.lang.String getValue(java.lang.String name)
AttributeList
The return value is the same as the return value for getValue(int).
If the attribute name has a namespace prefix in the document, the application must include the prefix here.
getValue
in interface AttributeList
getValue
in interface Attributes
name
- the name of the attribute to return
AttributeList.getValue(int)
public java.lang.String getValue(java.lang.String uri, java.lang.String localName)
Attributes
See getValue(int)
for a description
of the possible values.
getValue
in interface Attributes
uri
- The Namespace URI, or the empty String if the
name has no Namespace URI.localName
- The local name of the attribute.
public int getIndex(java.lang.String qName)
Attributes
getIndex
in interface Attributes
qName
- The qualified (prefixed) name.
public int getIndex(java.lang.String uri, java.lang.String localPart)
Attributes
getIndex
in interface Attributes
uri
- The Namespace URI, or the empty string if
the name has no Namespace URI.localPart
- The attribute's local name.
public boolean isDeclared(int index)
Attributes2
isDeclared
in interface Attributes2
index
- The attribute index (zero-based).
public boolean isDeclared(java.lang.String qName)
Attributes2
isDeclared
in interface Attributes2
qName
- The XML qualified (prefixed) name.
public boolean isDeclared(java.lang.String uri, java.lang.String localName)
Attributes2
Remember that since DTDs do not "understand" namespaces, the namespace URI associated with an attribute may not have come from the DTD. The declaration will have applied to the attribute's qName.
isDeclared
in interface Attributes2
uri
- The Namespace URI, or the empty string if
the name has no Namespace URI.localName
- The attribute's local name.
public boolean isSpecified(int index)
Attributes2
isSpecified
in interface Attributes2
index
- The attribute index (zero-based).
public boolean isSpecified(java.lang.String qName)
Attributes2
isSpecified
in interface Attributes2
qName
- The XML qualified (prefixed) name.
public boolean isSpecified(java.lang.String uri, java.lang.String localName)
Attributes2
Remember that since DTDs do not "understand" namespaces, the namespace URI associated with an attribute may not have come from the DTD. The declaration will have applied to the attribute's qName.
isSpecified
in interface Attributes2
uri
- The Namespace URI, or the empty string if
the name has no Namespace URI.localName
- The attribute's local name.
public java.lang.String getName(int i)
AttributeList
The names must be unique: the SAX parser shall not include the same attribute twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
If the attribute name has a namespace prefix, the prefix will still be attached.
getName
in interface AttributeList
i
- The index of the attribute in the list (starting at 0).
AttributeList.getLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |