Class UserDataAttribute

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Attribute, Node

    public class UserDataAttribute
    extends DefaultAttribute

    UserDataAttribute support the adornment of a user data object on an Element or Attribute instance such that the methods getData() setData(Object)will get and set the values of a user data object. This can be useful for developers wishing to create XML trees and adorn the trees with user defined objects.

    See Also:
    Serialized Form
    • Constructor Detail

      • UserDataAttribute

        public UserDataAttribute​(QName qname)
      • UserDataAttribute

        public UserDataAttribute​(QName qname,
                                 java.lang.String text)
    • Method Detail

      • getData

        public java.lang.Object getData()
        Description copied from interface: Attribute
        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().
        Specified by:
        getData in interface Attribute
        Overrides:
        getData in class AbstractAttribute
        Returns:
        the attribute data
      • setData

        public void setData​(java.lang.Object data)
        Description copied from interface: Attribute
        Sets the data value of this attribute if this element supports data binding or calls Node.setText(String)if it doesn't.
        Specified by:
        setData in interface Attribute
        Overrides:
        setData in class AbstractAttribute
        Parameters:
        data - the attribute data