|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Attribute
defines an XML attribute.
An attribute may have a name, an optional namespace and a value.
Field Summary |
Fields inherited from interface org.dom4j.Node |
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE |
Method Summary | |
java.lang.Object |
getData()
Accesses the data of this attribute which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value as Node.getText() |
Namespace |
getNamespace()
Returns the Namespace of this element if one exists
otherwise null is returned returned. |
java.lang.String |
getNamespacePrefix()
Returns the namespace prefix of this element if one exists otherwise an empty String is returned. |
java.lang.String |
getNamespaceURI()
Returns the URI mapped to the namespace of this element if one exists otherwise an empty String is returned. |
QName |
getQName()
Returns the QName of this attribute which represents
the local name, the qualified name and the Namespace . |
java.lang.String |
getQualifiedName()
Returns the fully qualified name of this element. |
java.lang.String |
getValue()
Returns the value of the attribute. |
void |
setData(java.lang.Object data)
Sets the data value of this attribute if this element supports data binding or calls Node.setText(java.lang.String) if it doesn't |
void |
setNamespace(Namespace namespace)
Sets the Namespace of this element or if this element
is read only then an UnsupportedOperationException
is thrown. |
void |
setValue(java.lang.String value)
Sets the value of this attribute or this method will throw an UnsupportedOperationException if it is
read-only. |
Methods inherited from interface org.dom4j.Node |
accept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getStringValue, getText, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write |
Method Detail |
public QName getQName()
Returns the QName
of this attribute which represents
the local name, the qualified name and the Namespace
.
QName
associated with this attributepublic Namespace getNamespace()
Returns the Namespace
of this element if one exists
otherwise null is returned returned.
Namespace
associated with this nodepublic void setNamespace(Namespace namespace)
Sets the Namespace
of this element or if this element
is read only then an UnsupportedOperationException
is thrown.
namespace
- is the Namespace
to associate with this
elementpublic java.lang.String getNamespacePrefix()
Returns the namespace prefix of this element if one exists
otherwise an empty String
is returned.
Namespace
of this element
or an empty String
public java.lang.String getNamespaceURI()
Returns the URI mapped to the namespace of this element
if one exists otherwise an empty String
is returned.
Namespace
of this element
or an empty String
public java.lang.String getQualifiedName()
Returns the fully qualified name of this element.
This will be the same as the value returned from Node.getName()
if this element has no namespace attached to this element or an
expression of the form
getNamespacePrefix() + ":" + getName()will be returned.
public java.lang.String getValue()
Returns the value of the attribute. This method
returns the same value as the Node.getText()
method.
public void setValue(java.lang.String value)
Sets the value of this attribute or this method will
throw an UnsupportedOperationException
if it is
read-only.
value
- is the new value of this attributepublic java.lang.Object getData()
Node.getText()
public void setData(java.lang.Object data)
Node.setText(java.lang.String)
if it doesn't
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |