Class ValidationObject

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    TableValidationObject

    public class ValidationObject
    extends java.util.EventObject
    ValidationObject is an object containing the information that needed by Validator. The base class has three things - source, new value and old value.

    The source is the object who has the Validator. In the case of cell editor, cell editor will be the source. In the case of table, source will be the table.

    Normally ValidationObject are accompanied by the old and new value. If the new value is a primitive type (such as int or boolean) it must be wrapped as the corresponding java.lang.* Object type (such as Integer or Boolean).

    Null values may be provided for the old and the new values if their true values are not known.

    Users can extend this class to create their own ValidationObject to provide additional information that needed by Validator. For example, TableValidationObject extends ValidationObject to add row and column information.

    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      ValidationObject​(java.lang.Object source, java.lang.Object oldValue, java.lang.Object newValue)
      Constructs a new ValidationObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getNewValue()
      Sets the new value, expressed as an Object.
      java.lang.Object getOldValue()
      Gets the old value, expressed as an Object.
      java.lang.String toString()  
      • Methods inherited from class java.util.EventObject

        getSource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ValidationObject

        public ValidationObject​(java.lang.Object source,
                                java.lang.Object oldValue,
                                java.lang.Object newValue)
        Constructs a new ValidationObject.
        Parameters:
        source - The source that sends this ValidationObject.
        oldValue - The old value.
        newValue - The new value.
    • Method Detail

      • getNewValue

        public java.lang.Object getNewValue()
        Sets the new value, expressed as an Object.
        Returns:
        The new value, expressed as an Object.
      • getOldValue

        public java.lang.Object getOldValue()
        Gets the old value, expressed as an Object.
        Returns:
        The old value, expressed as an Object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.EventObject