GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse
Interface Attribute

All Known Implementing Classes:
AbstractAttribute, MutableAttribute

public interface Attribute

Attribute, as presented to the application by the parser. Adds operators for getting type and value to the superinterface.


Method Summary
 boolean equals(Object obj)
           Define Attribute equality as identity of instances.
 QName getQName()
           Get QName.
 String getQuotableValue()
           Get attribute value that can be enclosed in quotes.
 String getType()
           Get attribute type.
 String getValue()
           Get attribute value.
 int hashCode()
           Returns Object.hashCode.
 boolean isDeclared()
           Ask whether the attribute was declared.
 boolean isSpecified()
           Ask whether the attribute value was provided from the input, rather than from a default value.
 

Method Detail

getQName

QName getQName()

Get QName.

This identifies the Attribute by namespace and local name.

Returns:
QName.

getType

String getType()

Get attribute type.

The attribute type must be 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 should report the type as "NMTOKEN".


getValue

String getValue()

Get attribute value.


getQuotableValue

String getQuotableValue()

Get attribute value that can be enclosed in quotes.


isDeclared

boolean isDeclared()

Ask whether the attribute was declared. When using a validating parser, an attribute is valid if and only if it was declared.


isSpecified

boolean isSpecified()

Ask whether the attribute value was provided from the input, rather than from a default value.


equals

boolean equals(Object obj)

Define Attribute equality as identity of instances.

Overrides:
equals in class Object

hashCode

int hashCode()

Returns Object.hashCode.

Overrides:
hashCode in class Object

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License