Class TimeDescriptor.TimeFieldHandler

All Implemented Interfaces:
ConfigurableFieldHandler, FieldHandler
Enclosing class:
TimeDescriptor

class TimeDescriptor.TimeFieldHandler extends XMLFieldHandler
A specialized FieldHandler for the XML Schema TimeDuration related types
Version:
$Revision $ $Date $
Author:
Arnaud Blandin
  • Constructor Details

    • TimeFieldHandler

      public TimeFieldHandler()
      Creates a new TimeFieldHandler
  • Method Details

    • getValue

      public Object getValue(Object target) throws IllegalStateException
      Returns the value of the field associated with this descriptor from the given target object.
      Specified by:
      getValue in interface FieldHandler
      Overrides:
      getValue in class XMLFieldHandler
      Parameters:
      target - the object to get the value from
      Returns:
      the value of the field associated with this descriptor from the given target object.
      Throws:
      IllegalStateException - The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object
    • setValue

      public void setValue(Object target, Object value) throws IllegalStateException
      Sets the value of the field associated with this descriptor.
      Specified by:
      setValue in interface FieldHandler
      Overrides:
      setValue in class XMLFieldHandler
      Parameters:
      target - the object in which to set the value
      value - the value of the field
      Throws:
      IllegalStateException - The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object.
    • resetValue

      public void resetValue(Object target) throws IllegalStateException
      Description copied from class: FieldHandlerFriend
      Sets the value of the field to a default value.

      Reference fields are set to null, primitive fields are set to their default value, collection fields are emptied of all elements.

      Specified by:
      resetValue in interface FieldHandler
      Overrides:
      resetValue in class XMLFieldHandler
      Parameters:
      target - The object
      Throws:
      IllegalStateException - The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object
    • checkValidity

      public void checkValidity(Object object) throws ValidityException, IllegalStateException
      Checks the field validity. Returns successfully if the field can be stored, is valid, etc, throws an exception otherwise.
      Specified by:
      checkValidity in interface FieldHandler
      Overrides:
      checkValidity in class ExtendedFieldHandler
      Parameters:
      object - The object
      Throws:
      ValidityException - The field is invalid, is required and null, or any other validity violation
      IllegalStateException - The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object
    • newInstance

      public Object newInstance(Object parent) throws IllegalStateException
      Creates a new instance of the object described by this field.
      Specified by:
      newInstance in interface FieldHandler
      Overrides:
      newInstance in class XMLFieldHandler
      Parameters:
      parent - The object for which the field is created
      Returns:
      A new instance of the field's value
      Throws:
      IllegalStateException - This field is a simple type and cannot be instantiated