Package com.topologi.diffx.xml.sax
Class XMLWriterSAX.AttributesImpl
java.lang.Object
com.topologi.diffx.xml.sax.XMLWriterSAX.AttributesImpl
- All Implemented Interfaces:
Attributes
- Enclosing class:
- XMLWriterSAX
A SAX attribute list implementation.
Note: the type of all attributes is CDATA.
- Version:
- 25 May 2005
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, String value) Adds an attribute to an attribute list.voidaddAttribute(String uri, String name, String value) Adds an attribute to an attribute list.intLook up the index of an attribute by Namespace name.intLook up the index of an attribute by Namespace name.intReturns the number of attributes in the list.getLocalName(int i) Returns the name of an attribute (by position).getQName(int i) This implementation always returns "".getType(int i) Returns the type of an attribute (by position).Returnsnullas qualified names are not available.Returns the type of an attribute (by name).getURI(int i) Returns the namespace URI of an attribute (by position).getValue(int i) Returns the value of an attribute (by position).Returnsnullas qualified names are not available.Returns the value of an attribute (by name).
-
Field Details
-
CDATA
The only type used in this class.- See Also:
-
uris
Namespace URIs of the attributes. -
names
QNames of the attributes. -
values
Values of the attributes.
-
-
Constructor Details
-
AttributesImpl
public AttributesImpl()Creates an empty attribute list.
-
-
Method Details
-
addAttribute
Adds an attribute to an attribute list.- Parameters:
name- The attribute name.value- The attribute value (must not be null).- See Also:
-
addAttribute
Adds an attribute to an attribute list.- Parameters:
uri- The namespace URI of the attributename- The attribute name.value- The attribute value (must not be null).- See Also:
-
getLength
public int getLength()Returns the number of attributes in the list.- Specified by:
getLengthin interfaceAttributes- Returns:
- The number of attributes in the list.
- See Also:
-
getQName
This implementation always returns "".- Specified by:
getQNamein interfaceAttributes- Parameters:
i- The position of the attribute in the list.- Returns:
- The attribute qualified name as a string;
or
nullif there is no attribute at that position. - See Also:
-
getLocalName
Returns the name of an attribute (by position).- Specified by:
getLocalNamein interfaceAttributes- Parameters:
i- The position of the attribute in the list.- Returns:
- The attribute name as a string;
or
nullif there is no attribute at that position. - See Also:
-
getType
Returns the type of an attribute (by position).- Specified by:
getTypein interfaceAttributes- Parameters:
i- The position of the attribute in the list.- Returns:
- The attribute type as "CDATA";
or
nullif there is no attribute at that position. - See Also:
-
getValue
Returns the value of an attribute (by position).- Specified by:
getValuein interfaceAttributes- Parameters:
i- The position of the attribute in the list.- Returns:
- The attribute value as a string;
or
nullif there is no attribute at that position. - See Also:
-
getURI
Returns the namespace URI of an attribute (by position).- Specified by:
getURIin interfaceAttributes- Parameters:
i- The position of the attribute in the list.- Returns:
- The attribute namespace URI as a string;
or
nullif there is no attribute at that position. - See Also:
-
getType
Returnsnullas qualified names are not available.- Specified by:
getTypein interfaceAttributes- Parameters:
qName- The attribute name.- Returns:
null- See Also:
-
getValue
Returnsnullas qualified names are not available.- Specified by:
getValuein interfaceAttributes- Parameters:
name- The attribute name.- See Also:
-
getType
Returns the type of an attribute (by name).- Specified by:
getTypein interfaceAttributes- Parameters:
uri- The namespace URI of the attribute.name- The attribute name.- Returns:
- The attribute type as a string ("NMTOKEN" for an enumeration, and "CDATA" if no declaration was read).
- See Also:
-
getValue
Returns the value of an attribute (by name).- Specified by:
getValuein interfaceAttributes- Parameters:
uri- The namespace URI of the attribute.name- The attribute name.- See Also:
-
getIndex
Look up the index of an attribute by Namespace name.- Specified by:
getIndexin interfaceAttributes- Parameters:
uri- The Namespace URI, or the empty string if the name has no Namespace URI.localName- The attribute's local name.- Returns:
- The index of the attribute, or -1 if it does not appear in the list.
-
getIndex
Look up the index of an attribute by Namespace name.- Specified by:
getIndexin interfaceAttributes- Parameters:
qName- The index of the given name.- Returns:
- The index of the attribute, or -1 if it does not appear in the list.
-