Class DataContent

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class DataContent
    extends org.jdom.Content
    A Content that holds a value in it, and when it's getValue method is called will return that value. Used by the JDOM builders for storing values in Elements.
    Author:
    Jerry Vos
    See Also:
    Serialized Form
    • Constructor Detail

      • DataContent

        public DataContent()
        Creates this without an object to use as data. Before this is used the setData(Object) method should be called
        See Also:
        setData(Object)
      • DataContent

        public DataContent​(Object data)
        Creates this with the specified object as data.
        Parameters:
        data - the object to used in getValue()
        See Also:
        getValue()
    • Method Detail

      • getValue

        public String getValue()
        Retrieves the string value of the data.
        Specified by:
        getValue in class org.jdom.Content
        Returns:
        null if the data is null, otherwise data.toString()
      • getData

        public Object getData()
        Retrieves the data to be used in the getValue() method.
        Returns:
        the data object
      • setData

        public void setData​(Object data)
        Sets the data to be used in the getValue() method.
        Parameters:
        data - the data object