Package org.exolab.castor.types
Class GMonthDayDescriptor.GMonthDayFieldHandler
- 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.GMonthDayDescriptor.GMonthDayFieldHandler
-
- All Implemented Interfaces:
ConfigurableFieldHandler,FieldHandler
- Enclosing class:
- GMonthDayDescriptor
class GMonthDayDescriptor.GMonthDayFieldHandler extends XMLFieldHandler
A specialized FieldHandler for the XML Schema TimeDuration related types- Version:
- $Revision $ $Date $
- Author:
- Arnaud Blandin
-
-
Field Summary
-
Fields inherited from class org.exolab.castor.mapping.AbstractFieldHandler
_properties
-
-
Constructor Summary
Constructors Constructor Description GMonthDayFieldHandler()Creates a new TimeFieldHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckValidity(java.lang.Object object)Checks the field validity.java.lang.ObjectgetValue(java.lang.Object target)Returns the value of the field associated with this descriptor from the given target object.java.lang.ObjectnewInstance(java.lang.Object parent)Creates a new instance of the object described by this field.voidresetValue(java.lang.Object target)Sets the value of the field to a default value.voidsetValue(java.lang.Object target, java.lang.Object value)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
-
-
-
-
Method Detail
-
getValue
public java.lang.Object getValue(java.lang.Object target) throws java.lang.IllegalStateExceptionReturns the value of the field associated with this descriptor from the given target object.- Specified by:
getValuein interfaceFieldHandler- Overrides:
getValuein 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:
java.lang.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(java.lang.Object target, java.lang.Object value) throws java.lang.IllegalStateExceptionSets the value of the field associated with this descriptor.- Specified by:
setValuein interfaceFieldHandler- Overrides:
setValuein classXMLFieldHandler- Parameters:
target- the object in which to set the valuevalue- the value of the field- Throws:
java.lang.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(java.lang.Object target) throws java.lang.IllegalStateExceptionDescription copied from class:FieldHandlerFriendSets 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:
resetValuein interfaceFieldHandler- Overrides:
resetValuein classXMLFieldHandler- Parameters:
target- The object- Throws:
java.lang.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(java.lang.Object object) throws ValidityException, java.lang.IllegalStateExceptionChecks the field validity. Returns successfully if the field can be stored, is valid, etc, throws an exception otherwise.- Specified by:
checkValidityin interfaceFieldHandler- Overrides:
checkValidityin classExtendedFieldHandler- Parameters:
object- The object- Throws:
ValidityException- The field is invalid, is required and null, or any other validity violationjava.lang.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 java.lang.Object newInstance(java.lang.Object parent) throws java.lang.IllegalStateExceptionCreates a new instance of the object described by this field.- Specified by:
newInstancein interfaceFieldHandler- Overrides:
newInstancein classXMLFieldHandler- Parameters:
parent- The object for which the field is created- Returns:
- A new instance of the field's value
- Throws:
java.lang.IllegalStateException- This field is a simple type and cannot be instantiated
-
-