Save This Page
Home » dom4j-1.6.1 » org.dom4j » [javadoc | source]
org.dom4j
public interface: Attribute [javadoc | source]

All Implemented Interfaces:
    Node

All Known Implementing Classes:
    DOMAttribute, FlyweightAttribute, DefaultAttribute, UserDataAttribute, BeanAttribute, DatatypeAttribute, AbstractAttribute

Attribute defines an XML attribute. An attribute may have a name, an optional namespace and a value.

Method from org.dom4j.Attribute Summary:
getData,   getNamespace,   getNamespacePrefix,   getNamespaceURI,   getQName,   getQualifiedName,   getValue,   setData,   setNamespace,   setValue
Method from org.dom4j.Attribute Detail:
 public 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() .

 public Namespace getNamespace()

    Returns the Namespace of this element if one exists otherwise null is returned returned.

 public String getNamespacePrefix()

    Returns the namespace prefix of this element if one exists otherwise an empty String is returned.

 public String getNamespaceURI()

    Returns the URI mapped to the namespace of this element if one exists otherwise an empty String is returned.

 public QName getQName()

    Returns the QName of this attribute which represents the local name, the qualified name and the Namespace.

 public 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 String getValue()

    Returns the value of the attribute. This method returns the same value as the Node#getText() method.

 public  void setData(Object data)

    Sets the data value of this attribute if this element supports data binding or calls Node#setText(String) if it doesn't.

 public  void setNamespace(Namespace namespace)

    Sets the Namespace of this element or if this element is read only then an UnsupportedOperationException is thrown.

 public  void setValue(String value)

    Sets the value of this attribute or this method will throw an UnsupportedOperationException if it is read-only.