Top Description Fields Constructors Methods
org.apache.xerces.util

public final Class AttributesProxy

extends Object
implements AttributeList, Attributes2
Class Inheritance
All Implemented Interfaces
org.xml.sax.ext.Attributes2, org.xml.sax.Attributes, org.xml.sax.AttributeList
Imports
org.apache.xerces.impl.Constants, org.apache.xerces.xni.XMLAttributes, org.xml.sax.AttributeList, org.xml.sax.ext.Attributes2

Deprecated

as a consequence of AttributeList being deprecated. See corresponding docs for further information.

Wraps XMLAttributes and makes it look like AttributeList and Attributes2.
Authors
Arnaud Le Hors, IBM, Andy Clark, IBM
Version
$Id: AttributesProxy.java 449487 2006-09-24 21:11:28Z mrglavas $

Field Summary

Modifier and TypeField and Description
private XMLAttributes
fAttributes

XML attributes.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public XMLAttributes
public int
getIndex(String
The qualified (prefixed) name.
qName
)

Implements org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by XML qualified (prefixed) name.
public int
getIndex(String
The Namespace URI, or the empty string if the name has no Namespace URI.
uri
,
String
The attribute's local name.
localPart
)

Implements org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by Namespace name.
public int
getLength()

Implements org.xml.sax.AttributeList.getLength, org.xml.sax.Attributes.getLength.

Return the number of attributes in this list.
public String
getLocalName(int
The attribute index (zero-based).
index
)

Implements org.xml.sax.Attributes.getLocalName.

Look up an attribute's local name by index.
public String
getName(int
The index of the attribute in the list (starting at 0).
i
)

Implements org.xml.sax.AttributeList.getName.

Return the name of an attribute in this list (by position).
public String
getQName(int
The attribute index (zero-based).
index
)

Implements org.xml.sax.Attributes.getQName.

Look up an attribute's XML qualified (prefixed) name by index.
public String
getType(int
The index of the attribute in the list (starting at 0).
i
)

Implements org.xml.sax.AttributeList.getType, org.xml.sax.Attributes.getType.

Return the type of an attribute in the list (by position).
public String
getType(String
The name of the attribute.
name
)

Implements org.xml.sax.AttributeList.getType, org.xml.sax.Attributes.getType.

Return the type of an attribute in the list (by name).
public String
getType(String
The Namespace URI, or the empty String if the name has no Namespace URI.
uri
,
String
The local name of the attribute.
localName
)

Implements org.xml.sax.Attributes.getType.

Look up an attribute's type by Namespace name.
public String
getURI(int
The attribute index (zero-based).
index
)

Implements org.xml.sax.Attributes.getURI.

Look up an attribute's Namespace URI by index.
public String
getValue(int
The index of the attribute in the list (starting at 0).
i
)

Implements org.xml.sax.AttributeList.getValue, org.xml.sax.Attributes.getValue.

Return the value of an attribute in the list (by position).
public String
getValue(String
the name of the attribute to return
name
)

Implements org.xml.sax.AttributeList.getValue, org.xml.sax.Attributes.getValue.

Return the value of an attribute in the list (by name).
public String
getValue(String
The Namespace URI, or the empty String if the name has no Namespace URI.
uri
,
String
The local name of the attribute.
localName
)

Implements org.xml.sax.Attributes.getValue.

Look up an attribute's value by Namespace name.
public boolean
isDeclared(int
The attribute index (zero-based).
index
)

Implements org.xml.sax.ext.Attributes2.isDeclared.

Returns false unless the attribute was declared in the DTD.
public boolean
isDeclared(String
The XML qualified (prefixed) name.
qName
)

Implements org.xml.sax.ext.Attributes2.isDeclared.

Returns false unless the attribute was declared in the DTD.
public boolean
isDeclared(String
The Namespace URI, or the empty string if the name has no Namespace URI.
uri
,
String
The attribute's local name.
localName
)

Implements org.xml.sax.ext.Attributes2.isDeclared.

Returns false unless the attribute was declared in the DTD.
public boolean
isSpecified(int
The attribute index (zero-based).
index
)

Implements org.xml.sax.ext.Attributes2.isSpecified.

Returns true unless the attribute value was provided by DTD defaulting.
public boolean
isSpecified(String
The XML qualified (prefixed) name.
qName
)

Implements org.xml.sax.ext.Attributes2.isSpecified.

Returns true unless the attribute value was provided by DTD defaulting.
public boolean
isSpecified(String
The Namespace URI, or the empty string if the name has no Namespace URI.
uri
,
String
The attribute's local name.
localName
)

Implements org.xml.sax.ext.Attributes2.isSpecified.

Returns true unless the attribute value was provided by DTD defaulting.
public void
setAttributes(XMLAttributes attributes)

Sets the XML attributes to be wrapped.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fAttributesback to summary
private XMLAttributes fAttributes

XML attributes.

Constructor Detail

AttributesProxyback to summary
public AttributesProxy(XMLAttributes attributes)

Method Detail

getAttributesback to summary
public XMLAttributes getAttributes()
getIndexback to summary
public int getIndex(String qName)

Implements org.xml.sax.Attributes.getIndex.

Doc from org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by XML qualified (prefixed) name.

Parameters
qName:String

The qualified (prefixed) name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getIndexback to summary
public int getIndex(String uri, String localPart)

Implements org.xml.sax.Attributes.getIndex.

Doc from org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by Namespace name.

Parameters
uri:String

The Namespace URI, or the empty string if the name has no Namespace URI.

localPart:String

The attribute's local name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getLengthback to summary
public int getLength()

Implements org.xml.sax.AttributeList.getLength, org.xml.sax.Attributes.getLength.

Doc from org.xml.sax.AttributeList.getLength.

Return the number of attributes in this list.

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.

Returns:int

The number of attributes in the list.

getLocalNameback to summary
public String getLocalName(int index)

Implements org.xml.sax.Attributes.getLocalName.

Doc from org.xml.sax.Attributes.getLocalName.

Look up an attribute's local name by index.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range.

getNameback to summary
public String getName(int i)

Implements org.xml.sax.AttributeList.getName.

Doc from org.xml.sax.AttributeList.getName.

Return the name of an attribute in this list (by position).

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.

Parameters
i:int

The index of the attribute in the list (starting at 0).

Returns:String

The name of the indexed attribute, or null if the index is out of range.

getQNameback to summary
public String getQName(int index)

Implements org.xml.sax.Attributes.getQName.

Doc from org.xml.sax.Attributes.getQName.

Look up an attribute's XML qualified (prefixed) name by index.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The XML qualified name, or the empty string if none is available, or null if the index is out of range.

getTypeback to summary
public String getType(int i)

Implements org.xml.sax.AttributeList.getType, org.xml.sax.Attributes.getType.

Doc from org.xml.sax.AttributeList.getType.

Return the type of an attribute in the list (by position).

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".

Parameters
i:int

The index of the attribute in the list (starting at 0).

Returns:String

The attribute type as a string, or null if the index is out of range.

getTypeback to summary
public String getType(String name)

Implements org.xml.sax.AttributeList.getType, org.xml.sax.Attributes.getType.

Doc from org.xml.sax.AttributeList.getType.

Return the type of an attribute in the list (by name).

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.

Parameters
name:String

The name of the attribute.

Returns:String

The attribute type as a string, or null if no such attribute exists.

getTypeback to summary
public String getType(String uri, String localName)

Implements org.xml.sax.Attributes.getType.

Doc from org.xml.sax.Attributes.getType.

Look up an attribute's type by Namespace name.

See getType(int) for a description of the possible types.

Parameters
uri:String

The Namespace URI, or the empty String if the name has no Namespace URI.

localName:String

The local name of the attribute.

Returns:String

The attribute type as a string, or null if the attribute is not in the list or if Namespace processing is not being performed.

getURIback to summary
public String getURI(int index)

Implements org.xml.sax.Attributes.getURI.

Doc from org.xml.sax.Attributes.getURI.

Look up an attribute's Namespace URI by index.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The Namespace URI, or the empty string if none is available, or null if the index is out of range.

getValueback to summary
public String getValue(int i)

Implements org.xml.sax.AttributeList.getValue, org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.AttributeList.getValue.

Return the value of an attribute in the list (by position).

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.

Parameters
i:int

The index of the attribute in the list (starting at 0).

Returns:String

The attribute value as a string, or null if the index is out of range.

getValueback to summary
public String getValue(String name)

Implements org.xml.sax.AttributeList.getValue, org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.AttributeList.getValue.

Return the value of an attribute in the list (by name).

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.

Parameters
name:String

the name of the attribute to return

Returns:String

The attribute value as a string, or null if no such attribute exists.

getValueback to summary
public String getValue(String uri, String localName)

Implements org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.Attributes.getValue.

Look up an attribute's value by Namespace name.

See getValue(int) for a description of the possible values.

Parameters
uri:String

The Namespace URI, or the empty String if the name has no Namespace URI.

localName:String

The local name of the attribute.

Returns:String

The attribute value as a string, or null if the attribute is not in the list.

isDeclaredback to summary
public boolean isDeclared(int index)

Implements org.xml.sax.ext.Attributes2.isDeclared.

Doc from org.xml.sax.ext.Attributes2.isDeclared.

Returns false unless the attribute was declared in the DTD. This helps distinguish two kinds of attributes that SAX reports as CDATA: ones that were declared (and hence are usually valid), and those that were not (and which are never valid).

Parameters
index:int

The attribute index (zero-based).

Returns:boolean

true if the attribute was declared in the DTD, false otherwise.

isDeclaredback to summary
public boolean isDeclared(String qName)

Implements org.xml.sax.ext.Attributes2.isDeclared.

Doc from org.xml.sax.ext.Attributes2.isDeclared.

Returns false unless the attribute was declared in the DTD. This helps distinguish two kinds of attributes that SAX reports as CDATA: ones that were declared (and hence are usually valid), and those that were not (and which are never valid).

Parameters
qName:String

The XML qualified (prefixed) name.

Returns:boolean

true if the attribute was declared in the DTD, false otherwise.

isDeclaredback to summary
public boolean isDeclared(String uri, String localName)

Implements org.xml.sax.ext.Attributes2.isDeclared.

Doc from org.xml.sax.ext.Attributes2.isDeclared.

Returns false unless the attribute was declared in the DTD. This helps distinguish two kinds of attributes that SAX reports as CDATA: ones that were declared (and hence are usually valid), and those that were not (and which are never valid).

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.

Parameters
uri:String

The Namespace URI, or the empty string if the name has no Namespace URI.

localName:String

The attribute's local name.

Returns:boolean

true if the attribute was declared in the DTD, false otherwise.

isSpecifiedback to summary
public boolean isSpecified(int index)

Implements org.xml.sax.ext.Attributes2.isSpecified.

Doc from org.xml.sax.ext.Attributes2.isSpecified.

Returns true unless the attribute value was provided by DTD defaulting.

Parameters
index:int

The attribute index (zero-based).

Returns:boolean

true if the value was found in the XML text, false if the value was provided by DTD defaulting.

isSpecifiedback to summary
public boolean isSpecified(String qName)

Implements org.xml.sax.ext.Attributes2.isSpecified.

Doc from org.xml.sax.ext.Attributes2.isSpecified.

Returns true unless the attribute value was provided by DTD defaulting.

Parameters
qName:String

The XML qualified (prefixed) name.

Returns:boolean

true if the value was found in the XML text, false if the value was provided by DTD defaulting.

isSpecifiedback to summary
public boolean isSpecified(String uri, String localName)

Implements org.xml.sax.ext.Attributes2.isSpecified.

Doc from org.xml.sax.ext.Attributes2.isSpecified.

Returns true unless the attribute value was provided by DTD defaulting.

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.

Parameters
uri:String

The Namespace URI, or the empty string if the name has no Namespace URI.

localName:String

The attribute's local name.

Returns:boolean

true if the value was found in the XML text, false if the value was provided by DTD defaulting.

setAttributesback to summary
public void setAttributes(XMLAttributes attributes)

Sets the XML attributes to be wrapped.