|
GXPARSE hosted by |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.gorman.xml.parse.toolkit.AbstractAttribute
public abstract class AbstractAttribute
Abstract realization of Attribute
.
This is a common base class for the parser's internal view of Attribute objects and the application programmer's external view of Attribute objects. Attributes are presented to the application programmer as immutable objects, but are treated as mutable objects inside the parser. The mutable version is created by subclassing to expose the setters.
Constructor Summary | |
---|---|
protected |
AbstractAttribute()
Create an uninitialized AbstractAttribute. |
protected |
AbstractAttribute(Attribute attribute)
Create an initialized AbstractAttribute. |
protected |
AbstractAttribute(QName qName,
String type)
Create an uninitialized AbstractAttribute. |
protected |
AbstractAttribute(QName qName,
String type,
String value,
boolean isDeclared,
boolean isSpecified)
Create an initialized AbstractAttribute. |
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. |
AbstractAttribute |
newInstance(QName qName,
String type,
String value,
boolean isDeclared,
boolean isSpecified)
Create an immutable AbstractAttribute. |
protected void |
setDeclared(boolean b)
Indicate whether the attribute was declared.. |
protected void |
setQName(QName qName)
Set attribute name. |
protected void |
setSpecified(boolean b)
Indicate whether the attribute value was provided from the input, rather than from a default value. |
protected void |
setType(String type)
Set attribute type. |
protected void |
setValue(String value)
Set attribute value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractAttribute(QName qName, String type)
Create an uninitialized AbstractAttribute.
protected AbstractAttribute(QName qName, String type, String value, boolean isDeclared, boolean isSpecified)
Create an initialized AbstractAttribute.
protected AbstractAttribute(Attribute attribute)
Create an initialized AbstractAttribute.
protected AbstractAttribute()
Create an uninitialized AbstractAttribute.
Method Detail |
---|
public AbstractAttribute newInstance(QName qName, String type, String value, boolean isDeclared, boolean isSpecified)
Create an immutable AbstractAttribute.
NullPointerException
- if qName
is nullpublic final QName getQName()
Attribute
Get QName
.
This identifies the Attribute
by namespace and local name.
getQName
in interface Attribute
protected void setQName(QName qName)
Set attribute name.
NullPointerException
- if qName
is nullpublic final String getType()
Attribute
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".
getType
in interface Attribute
protected void setType(String type)
Set attribute type.
NullPointerException
- if type
is nullpublic final String getValue()
Attribute
Get attribute value.
getValue
in interface Attribute
protected void setValue(String value)
Set attribute value.
NullPointerException
- if value
is nullpublic final String getQuotableValue()
Attribute
Get attribute value that can be enclosed in quotes.
getQuotableValue
in interface Attribute
public boolean isDeclared()
Attribute
Ask whether the attribute was declared. When using a validating parser, an attribute is valid if and only if it was declared.
isDeclared
in interface Attribute
protected void setDeclared(boolean b)
Indicate whether the attribute was declared..
public boolean isSpecified()
Attribute
Ask whether the attribute value was provided from the input, rather than from a default value.
isSpecified
in interface Attribute
protected void setSpecified(boolean b)
Indicate whether the attribute value was provided from the input, rather than from a default value.
public final boolean equals(Object obj)
Attribute
Define Attribute
equality as identity of instances.
equals
in interface Attribute
equals
in class Object
public final int hashCode()
Attribute
Returns Object.hashCode
.
hashCode
in interface Attribute
hashCode
in class Object
|
GXPARSE download | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |