Public Member Functions | |
Attribute (String name, String value, Namespace namespace) | |
Attribute (String name, String value, int type, Namespace namespace) | |
Attribute (String name, String value) | |
Attribute (String name, String value, int type) | |
Element | getParent () |
Document | getDocument () |
Attribute | detach () |
String | getName () |
Attribute | setName (String name) |
String | getQualifiedName () |
String | getNamespacePrefix () |
String | getNamespaceURI () |
Namespace | getNamespace () |
Attribute | setNamespace (Namespace namespace) |
String | getValue () |
Attribute | setValue (String value) |
int | getAttributeType () |
Attribute | setAttributeType (int type) |
String | toString () |
final boolean | equals (Object ob) |
final int | hashCode () |
Object | clone () |
int | getIntValue () throws DataConversionException |
long | getLongValue () throws DataConversionException |
float | getFloatValue () throws DataConversionException |
double | getDoubleValue () throws DataConversionException |
boolean | getBooleanValue () throws DataConversionException |
Static Public Attributes | |
static final int | UNDECLARED_ATTRIBUTE = 0 |
static final int | CDATA_ATTRIBUTE = 1 |
static final int | ID_ATTRIBUTE = 2 |
static final int | IDREF_ATTRIBUTE = 3 |
static final int | IDREFS_ATTRIBUTE = 4 |
static final int | ENTITY_ATTRIBUTE = 5 |
static final int | ENTITIES_ATTRIBUTE = 6 |
static final int | NMTOKEN_ATTRIBUTE = 7 |
static final int | NMTOKENS_ATTRIBUTE = 8 |
static final int | NOTATION_ATTRIBUTE = 9 |
static final int | ENUMERATED_ATTRIBUTE = 10 |
Protected Member Functions | |
Attribute () | |
Attribute | setParent (Element parent) |
Protected Attributes | |
String | name |
String | value |
int | type = UNDECLARED_ATTRIBUTE |
Object | parent |
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.
org::jdom::Attribute::Attribute | ( | ) | [inline, protected] |
Default, no-args constructor for implementations to use if needed.
org::jdom::Attribute::Attribute | ( | String | name, | |
String | value, | |||
Namespace | namespace | |||
) | [inline] |
This will create a new Attribute
with the specified (local) name and value, and in the provided Namespace
.
name | String name of Attribute . | |
value | String value for new attribute. | |
namespace | Namespace namespace for new attribute. |
IllegalNameException | if the given name is illegal as an attribute name or if if the new namespace is the default namespace. Attributes cannot be in a default namespace. | |
IllegalDataException | if the given attribute value is illegal character data (as determined by org.jdom.Verifier#checkCharacterData). |
org::jdom::Attribute::Attribute | ( | String | name, | |
String | value, | |||
int | type, | |||
Namespace | namespace | |||
) | [inline] |
This will create a new Attribute
with the specified (local) name, value, and type, and in the provided Namespace
.
name | String name of Attribute . | |
value | String value for new attribute. | |
type | int type for new attribute. | |
namespace | Namespace namespace for new attribute. |
IllegalNameException | if the given name is illegal as an attribute name or if if the new namespace is the default namespace. Attributes cannot be in a default namespace. | |
IllegalDataException | if the given attribute value is illegal character data (as determined by org.jdom.Verifier#checkCharacterData) or if the given attribute type is not one of the supported types. |
org::jdom::Attribute::Attribute | ( | String | name, | |
String | value | |||
) | [inline] |
This will create a new Attribute
with the specified (local) name and value, and does not place the attribute in a Namespace
.
Note: This actually explicitly puts the Attribute
in the "empty" Namespace
(Namespace#NO_NAMESPACE
).
name | String name of Attribute . | |
value | String value for new attribute. |
IllegalNameException | if the given name is illegal as an attribute name. | |
IllegalDataException | if the given attribute value is illegal character data (as determined by org.jdom.Verifier#checkCharacterData). |
org::jdom::Attribute::Attribute | ( | String | name, | |
String | value, | |||
int | type | |||
) | [inline] |
This will create a new Attribute
with the specified (local) name, value and type, and does not place the attribute in a Namespace
.
Note: This actually explicitly puts the Attribute
in the "empty" Namespace
(Namespace#NO_NAMESPACE
).
name | String name of Attribute . | |
value | String value for new attribute. | |
type | int type for new attribute. |
IllegalNameException | if the given name is illegal as an attribute name. | |
IllegalDataException | if the given attribute value is illegal character data (as determined by org.jdom.Verifier#checkCharacterData) or if the given attribute type is not one of the supported types. |
Element org::jdom::Attribute::getParent | ( | ) | [inline] |
Document org::jdom::Attribute::getDocument | ( | ) | [inline] |
Attribute org::jdom::Attribute::detach | ( | ) | [inline] |
String org::jdom::Attribute::getName | ( | ) | [inline] |
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, the local name is simply the attribute name.
To obtain the namespace prefix for this attribute, the getNamespacePrefix()
method should be used.
String
- name of this attribute, without any namespace prefix. Attribute org::jdom::Attribute::setName | ( | String | name | ) | [inline] |
This sets the local name of the Attribute
.
Attribute
- the attribute modified. IllegalNameException | if the given name is illegal as an attribute name. |
String org::jdom::Attribute::getQualifiedName | ( | ) | [inline] |
This will retrieve the qualified name of the Attribute
. For any XML attribute whose name is [namespacePrefix]:[elementName]
, the qualified name of the attribute would be everything (both namespace prefix and element name). When the attribute has no namespace, the qualified name is simply the attribute's local name.
To obtain the local name of the attribute, the getName()
method should be used.
To obtain the namespace prefix for this attribute, the getNamespacePrefix()
method should be used.
String
- full name for this element. String org::jdom::Attribute::getNamespacePrefix | ( | ) | [inline] |
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, an empty String
is returned.
String
- namespace prefix of this attribute. String org::jdom::Attribute::getNamespaceURI | ( | ) | [inline] |
Namespace org::jdom::Attribute::getNamespace | ( | ) | [inline] |
This sets this Attribute
's Namespace
. If the provided namespace is null, the attribute will have no namespace. The namespace must have a prefix.
Element
- the element modified. IllegalNameException | if the new namespace is the default namespace. Attributes cannot be in a default namespace. |
String org::jdom::Attribute::getValue | ( | ) | [inline] |
This will return the actual textual value of this Attribute
. This will include all text within the quotation marks.
String
- value for this attribute. Attribute org::jdom::Attribute::setValue | ( | String | value | ) | [inline] |
This will set the value of the Attribute
.
value | String value for the attribute. |
IllegalDataException | if the given attribute value is illegal character data (as determined by org.jdom.Verifier#checkCharacterData). |
int org::jdom::Attribute::getAttributeType | ( | ) | [inline] |
Attribute org::jdom::Attribute::setAttributeType | ( | int | type | ) | [inline] |
This will set the type of the Attribute
.
type | int type for the attribute. |
IllegalDataException | if the given attribute type is not one of the supported types. |
String org::jdom::Attribute::toString | ( | ) | [inline] |
final boolean org::jdom::Attribute::equals | ( | Object | ob | ) | [inline] |
final int org::jdom::Attribute::hashCode | ( | ) | [inline] |
Object org::jdom::Attribute::clone | ( | ) | [inline] |
int org::jdom::Attribute::getIntValue | ( | ) | throws DataConversionException [inline] |
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. |
long org::jdom::Attribute::getLongValue | ( | ) | throws DataConversionException [inline] |
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. |
float org::jdom::Attribute::getFloatValue | ( | ) | throws DataConversionException [inline] |
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. |
double org::jdom::Attribute::getDoubleValue | ( | ) | throws DataConversionException [inline] |
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. |
boolean org::jdom::Attribute::getBooleanValue | ( | ) | throws DataConversionException [inline] |
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. |
final int org::jdom::Attribute::UNDECLARED_ATTRIBUTE = 0 [static] |
final int org::jdom::Attribute::CDATA_ATTRIBUTE = 1 [static] |
final int org::jdom::Attribute::ID_ATTRIBUTE = 2 [static] |
final int org::jdom::Attribute::IDREF_ATTRIBUTE = 3 [static] |
Attribute type: the attribute value is a reference to a unique identifier.
final int org::jdom::Attribute::IDREFS_ATTRIBUTE = 4 [static] |
Attribute type: the attribute value is a list of references to unique identifiers.
final int org::jdom::Attribute::ENTITY_ATTRIBUTE = 5 [static] |
final int org::jdom::Attribute::ENTITIES_ATTRIBUTE = 6 [static] |
final int org::jdom::Attribute::NMTOKEN_ATTRIBUTE = 7 [static] |
Attribute type: the attribute value is a name token.
According to SAX 2.0 specification, attributes of enumerated types should be reported as "NMTOKEN" by SAX parsers. But the major parsers (Xerces and Crimson) provide specific values that permit to recognize them as ENUMERATED_ATTRIBUTE.
final int org::jdom::Attribute::NMTOKENS_ATTRIBUTE = 8 [static] |
final int org::jdom::Attribute::NOTATION_ATTRIBUTE = 9 [static] |
final int org::jdom::Attribute::ENUMERATED_ATTRIBUTE = 10 [static] |
String org::jdom::Attribute::name [protected] |
The local name of the Attribute
String org::jdom::Attribute::value [protected] |
The value of the Attribute
int org::jdom::Attribute::type = UNDECLARED_ATTRIBUTE [protected] |
The type of the Attribute
Object org::jdom::Attribute::parent [protected] |
Parent element, or null if none