|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.jdom.Attribute
Attribute defines behavior for an XML
attribute, modeled in Java. Methods allow the user
to obtain the value of the attribute as well as
namespace information.
| Field Summary | |
protected java.lang.String |
name
The local name of the Attribute |
protected java.lang.String |
prefix
The namespace prefix of the Attribute |
protected java.lang.String |
value
The value of the Attribute |
| Constructor Summary | |
protected |
Attribute()
Default, no-args constructor for implementations to use if needed. |
|
Attribute(java.lang.String name,
java.lang.String value)
This will create a new Attribute with the
specified name and value. |
|
Attribute(java.lang.String prefix,
java.lang.String name,
java.lang.String value)
This will create a new Attribute with the
specified name and value. |
| Method Summary | |
boolean |
getBooleanValue()
This gets the value of the attribute, in boolean form, and if no conversion
can occur, throws a
|
boolean |
getBooleanValue(boolean defaultValue)
This gets the value of the attribute, in boolean form, and if no conversion
can occur, returns the supplied default
value. |
byte |
getByteValue()
This gets the value of the attribute, in byte form, and if no conversion
can occur, throws a
|
byte |
getByteValue(byte defaultValue)
This gets the value of the attribute, in byte form, and if no conversion
can occur, returns the supplied default
value. |
char |
getCharValue()
This gets the value of the attribute, in char form, and if no conversion
can occur, throws a
|
char |
getCharValue(char defaultValue)
This gets the value of the attribute, in char form, and if no conversion
can occur, returns the supplied default
value. |
double |
getDoubleValue()
This gets the value of the attribute, in double form, and if no conversion
can occur, throws a
|
double |
getDoubleValue(double defaultValue)
This gets the value of the attribute, in double form, and if no conversion
can occur, returns the supplied default
value. |
float |
getFloatValue()
This gets the value of the attribute, in float form, and if no conversion
can occur, throws a
|
float |
getFloatValue(float defaultValue)
This gets the value of the attribute, in float form, and if no conversion
can occur, returns the supplied default
value. |
java.lang.String |
getFullName()
This will retrieve the full name of the Attrbute. |
int |
getIntValue()
This gets the value of the attribute, in int form, and if no conversion
can occur, throws a
|
int |
getIntValue(int defaultValue)
This gets the value of the attribute, in int form, and if no conversion
can occur, returns the supplied default
value. |
long |
getLongValue()
This gets the value of the attribute, in long form, and if no conversion
can occur, throws a
|
long |
getLongValue(long defaultValue)
This gets the value of the attribute, in long form, and if no conversion
can occur, returns the supplied default
value. |
java.lang.String |
getName()
This will retrieve the local name of the Attribute. |
java.lang.String |
getNamespacePrefix()
This will retrieve the namespace prefix of the Attribute. |
java.lang.String |
getValue()
This will return the actual textual value of this Attribute. |
java.lang.String |
getValue(java.lang.String defaultValue)
This will return the actual textual value of this Attribute. |
void |
setValue(java.lang.String value)
This will set the value of the Attribute. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.lang.String name
Attributeprotected java.lang.String prefix
Attributeprotected java.lang.String value
Attribute| Constructor Detail |
protected Attribute()
Default, no-args constructor for implementations to use if needed.
public Attribute(java.lang.String prefix,
java.lang.String name,
java.lang.String value)
This will create a new Attribute with the
specified name and value.
prefix - String prefix for Attribute.name - String local name of Attribute.value - String value for new attribute.
public Attribute(java.lang.String name,
java.lang.String value)
This will create a new Attribute with the
specified name and value.
fullName - String name of Attribute.value - String value for new attribute.| Method Detail |
public java.lang.String getName()
This will retrieve the local name of the
Attribute. For any XML attribute
which appears as
[namespacePrefix]:[attributeName],
the local name of the attribute would be
[attributeName]. When the attribute
has no namespace prefix (and is in the default
namespace), the local name is simply the attribute
name.
To obtain the namespace prefix for this
attribute, the
method should be used.
getNamespacePrefix()
String - name of this attribute,
without any namespace prefix.public java.lang.String getFullName()
This will retrieve the full name of the Attrbute.
For any XML attribute whose name is
[namespacePrefix]:[elementName],
the full name of the attribute would be
everything (both namespace prefix and
element name). When the attribute has no
namespace prefix (and is in the default
namespace), the full name is simply the attribute's
local name.
To obtain the local name of the attribute, the
method should be used.
getName()
To obtain the namespace prefix for this attribute,
the
method should be used.
getNamespacePrefix()
String - full name for this element.public java.lang.String getNamespacePrefix()
This will retrieve the namespace prefix of the
Attribute. For any XML attribute
which appears as
[namespacePrefix]:[attributeName],
the namespace prefix of the attribute would be
[namespacePrefix]. When the attribute
has no namespace prefix (and is in the default
namespace), an empty String is returned.
String - namespace prefix of this
attribute.public java.lang.String getValue()
This will return the actual textual value of this
Attribute. This will include all text
within the quotation marks.
String - value for this attribute.public void setValue(java.lang.String value)
This will set the value of the Attribute.
value - String value for the attribute.public java.lang.String getValue(java.lang.String defaultValue)
This will return the actual textual value of this
Attribute. This will include all text
within the quotation marks. If no value exists, the
supplied default value will be returned.
defaultValue - String default value.String - value for this attribute.public int getIntValue(int defaultValue)
This gets the value of the attribute, in
int form, and if no conversion
can occur, returns the supplied default
value.
defaultValue - int default.int value of attribute.
public int getIntValue()
throws DataConversionException
This gets the value of the attribute, in
int form, and if no conversion
can occur, throws a
DataConversionException
int value of attribute.DataConversionException - - when conversion fails.public long getLongValue(long defaultValue)
This gets the value of the attribute, in
long form, and if no conversion
can occur, returns the supplied default
value.
defaultValue - long default.long value of attribute.
public long getLongValue()
throws DataConversionException
This gets the value of the attribute, in
long form, and if no conversion
can occur, throws a
DataConversionException
long value of attribute.DataConversionException - - when conversion fails.public float getFloatValue(float defaultValue)
This gets the value of the attribute, in
float form, and if no conversion
can occur, returns the supplied default
value.
defaultValue - float default.float value of attribute.
public float getFloatValue()
throws DataConversionException
This gets the value of the attribute, in
float form, and if no conversion
can occur, throws a
DataConversionException
float value of attribute.DataConversionException - - when conversion fails.public double getDoubleValue(double defaultValue)
This gets the value of the attribute, in
double form, and if no conversion
can occur, returns the supplied default
value.
defaultValue - double default.double value of attribute.
public double getDoubleValue()
throws DataConversionException
This gets the value of the attribute, in
double form, and if no conversion
can occur, throws a
DataConversionException
double value of attribute.DataConversionException - - when conversion fails.public boolean getBooleanValue(boolean defaultValue)
This gets the value of the attribute, in
boolean form, and if no conversion
can occur, returns the supplied default
value.
defaultValue - boolean default.boolean value of attribute.
public boolean getBooleanValue()
throws DataConversionException
This gets the value of the attribute, in
boolean form, and if no conversion
can occur, throws a
DataConversionException
boolean value of attribute.DataConversionException - - when conversion fails.public char getCharValue(char defaultValue)
This gets the value of the attribute, in
char form, and if no conversion
can occur, returns the supplied default
value.
char value of attribute.DataConversionException - - when conversion fails.
public char getCharValue()
throws DataConversionException
This gets the value of the attribute, in
char form, and if no conversion
can occur, throws a
DataConversionException
char value of attribute.DataConversionException - - when conversion fails.public byte getByteValue(byte defaultValue)
This gets the value of the attribute, in
byte form, and if no conversion
can occur, returns the supplied default
value.
defaultValue - byte default.byte value of attribute.
public byte getByteValue()
throws DataConversionException
This gets the value of the attribute, in
byte form, and if no conversion
can occur, throws a
DataConversionException
byte value of attribute.DataConversionException - - when conversion fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||