Package org.exolab.castor.types
Class TimeDurationDescriptor.TimeDurationFieldHandler
java.lang.Object
org.exolab.castor.mapping.loader.FieldHandlerFriend
org.exolab.castor.mapping.ExtendedFieldHandler
org.exolab.castor.mapping.AbstractFieldHandler
org.exolab.castor.xml.XMLFieldHandler
org.exolab.castor.types.TimeDurationDescriptor.TimeDurationFieldHandler
- All Implemented Interfaces:
ConfigurableFieldHandler
,FieldHandler
- Enclosing class:
- TimeDurationDescriptor
A specialized FieldHandler for the XML Schema TimeDuration related types
- Version:
- $Revision: 8145 $ $Date: $
- Author:
- Arnaud Blandin
-
Field Summary
Fields inherited from class org.exolab.castor.mapping.AbstractFieldHandler
_properties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkValidity
(Object object) Checks the field validity.Returns the value of the field associated with this descriptor from the given target object.newInstance
(Object parent) Creates a new instance of the object described by this field.void
resetValue
(Object target) Sets the value of the field to a default value.void
Sets the value of the field associated with this descriptor.Methods inherited from class org.exolab.castor.xml.XMLFieldHandler
equals, newInstance
Methods inherited from class org.exolab.castor.mapping.AbstractFieldHandler
getFieldDescriptor, hasValue, setConfiguration, setFieldDescriptor
-
Constructor Details
-
TimeDurationFieldHandler
public TimeDurationFieldHandler()Creates a new TimeDurationFieldHandler
-
-
Method Details
-
getValue
Returns the value of the field associated with this descriptor from the given target object.- Specified by:
getValue
in interfaceFieldHandler
- Overrides:
getValue
in classXMLFieldHandler
- 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
Sets the value of the field associated with this descriptor.- Specified by:
setValue
in interfaceFieldHandler
- Overrides:
setValue
in classXMLFieldHandler
- Parameters:
target
- the object in which to set the valuevalue
- 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
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 interfaceFieldHandler
- Overrides:
resetValue
in classXMLFieldHandler
- 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
Checks the field validity. Returns successfully if the field can be stored, is valid, etc, throws an exception otherwise.- Specified by:
checkValidity
in interfaceFieldHandler
- Overrides:
checkValidity
in classExtendedFieldHandler
- Parameters:
object
- The object- Throws:
ValidityException
- The field is invalid, is required and null, or any other validity violationIllegalStateException
- The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object
-
newInstance
Creates a new instance of the object described by this field.- Specified by:
newInstance
in interfaceFieldHandler
- Overrides:
newInstance
in classXMLFieldHandler
- 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
-