Public Member Functions | |
boolean | hasValue (Object object) |
abstract Object | getValue (Object object) throws IllegalStateException |
abstract Object | newInstance (Object parent) throws IllegalStateException |
abstract Object | newInstance (Object parent, Object[] args) throws IllegalStateException |
abstract void | resetValue (Object object) throws IllegalStateException, IllegalArgumentException |
abstract void | setValue (Object object, Object value) throws IllegalStateException, IllegalArgumentException |
Protected Member Functions | |
AbstractFieldHandler () | |
final FieldDescriptor | getFieldDescriptor () |
final void | setFieldDescriptor (FieldDescriptor fieldDesc) |
An extended version of the FieldHandler interface which is used for adding additional functionality while preserving backward compatability.
org.exolab.castor.mapping.AbstractFieldHandler.AbstractFieldHandler | ( | ) | [protected] |
Creates a new default AbstractFieldHandler. This method should be called by all extending classes so that any important initialization code will be executed.
final FieldDescriptor org.exolab.castor.mapping.AbstractFieldHandler.getFieldDescriptor | ( | ) | [protected, virtual] |
Returns the FieldDescriptor for the field that this handler is reponsibile for, or null if no FieldDescriptor has been set. This method is useful for implementations of the FieldHandler interface that wish to obtain information about the field in order to make the FieldHandler more generic and reusable, or simply for validation purposes.
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
abstract Object org.exolab.castor.mapping.AbstractFieldHandler.getValue | ( | Object | object | ) | throws IllegalStateException [pure virtual] |
Returns the value of the field from the object.
object | The object |
IllegalStateException | The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object |
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
Implemented in org.exolab.castor.mapping.GeneralizedFieldHandler, org.exolab.castor.mapping.handlers.TransientFieldHandler, org.exolab.castor.mapping.loader.FieldHandlerImpl, org.exolab.castor.types.CenturyDescriptor.CenturyFieldHandler, org.exolab.castor.types.DateDescriptor.DateFieldHandler, org.exolab.castor.types.DurationDescriptor.DurationFieldHandler, org.exolab.castor.types.GDayDescriptor.GDayFieldHandler, org.exolab.castor.types.GMonthDayDescriptor.GMonthDayFieldHandler, org.exolab.castor.types.GMonthDescriptor.GMonthFieldHandler, org.exolab.castor.types.GYearDescriptor.GYearFieldHandler, org.exolab.castor.types.GYearMonthDescriptor.GYearMonthFieldHandler, org.exolab.castor.types.MonthDescriptor.MonthFieldHandler, org.exolab.castor.types.RecurringDurationDescriptor.RecurringDurationFieldHandler, org.exolab.castor.types.TimeDescriptor.TimeFieldHandler, org.exolab.castor.types.TimeDurationDescriptor.TimeDurationFieldHandler, org.exolab.castor.types.TimePeriodDescriptor.TimePeriodFieldHandler, org.exolab.castor.types.YearDescriptor.YearFieldHandler, org.exolab.castor.xml.handlers.CollectionFieldHandler, org.exolab.castor.xml.handlers.DateFieldHandler, and org.exolab.castor.xml.XMLFieldHandler.
Referenced by org.exolab.castor.mapping.AbstractFieldHandler.hasValue().
boolean org.exolab.castor.mapping.AbstractFieldHandler.hasValue | ( | Object | object | ) |
Returns true if the "handled" field has a value within the given object.
By default this just checks for null. Normally this method is needed for checking if a value has been set via a call to the setValue method, or if the primitive value has been initialized by the JVM.
This method should be overloaded for improved value checking.
References org.exolab.castor.mapping.AbstractFieldHandler.getValue().
abstract Object org.exolab.castor.mapping.AbstractFieldHandler.newInstance | ( | Object | parent | ) | throws IllegalStateException [pure virtual] |
Creates a new instance of the object described by this field.
parent | The object for which the field is created |
IllegalStateException | This field is a simple type and cannot be instantiated |
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
Implemented in org.exolab.castor.mapping.GeneralizedFieldHandler, org.exolab.castor.mapping.handlers.EnumFieldHandler, org.exolab.castor.mapping.handlers.TransientFieldHandler, org.exolab.castor.mapping.loader.FieldHandlerImpl, org.exolab.castor.types.CenturyDescriptor.CenturyFieldHandler, org.exolab.castor.types.DateDescriptor.DateFieldHandler, org.exolab.castor.types.DurationDescriptor.DurationFieldHandler, org.exolab.castor.types.GDayDescriptor.GDayFieldHandler, org.exolab.castor.types.GMonthDayDescriptor.GMonthDayFieldHandler, org.exolab.castor.types.GMonthDescriptor.GMonthFieldHandler, org.exolab.castor.types.GYearDescriptor.GYearFieldHandler, org.exolab.castor.types.GYearMonthDescriptor.GYearMonthFieldHandler, org.exolab.castor.types.MonthDescriptor.MonthFieldHandler, org.exolab.castor.types.RecurringDurationDescriptor.RecurringDurationFieldHandler, org.exolab.castor.types.TimeDescriptor.TimeFieldHandler, org.exolab.castor.types.TimeDurationDescriptor.TimeDurationFieldHandler, org.exolab.castor.types.TimePeriodDescriptor.TimePeriodFieldHandler, org.exolab.castor.types.YearDescriptor.YearFieldHandler, org.exolab.castor.xml.handlers.CollectionFieldHandler, org.exolab.castor.xml.handlers.DateFieldHandler, org.exolab.castor.xml.handlers.SQLTimeFieldHandler, org.exolab.castor.xml.handlers.SQLTimestampFieldHandler, org.exolab.castor.xml.handlers.ValueOfFieldHandler, and org.exolab.castor.xml.XMLFieldHandler.
abstract Object org.exolab.castor.mapping.AbstractFieldHandler.newInstance | ( | Object | parent, | |
Object[] | args | |||
) | throws IllegalStateException [pure virtual] |
Creates a new instance of the object described by this field.
parent | The object for which the field is created | |
args | the set of constructor arguments |
IllegalStateException | This field is a simple type and cannot be instantiated |
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
Implemented in org.exolab.castor.mapping.GeneralizedFieldHandler, org.exolab.castor.mapping.handlers.EnumFieldHandler, org.exolab.castor.mapping.handlers.TransientFieldHandler, org.exolab.castor.mapping.loader.FieldHandlerImpl, and org.exolab.castor.xml.XMLFieldHandler.
abstract void org.exolab.castor.mapping.AbstractFieldHandler.resetValue | ( | Object | object | ) | throws IllegalStateException, IllegalArgumentException [pure virtual] |
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.
object | The object |
IllegalStateException | The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object |
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
Implemented in org.exolab.castor.mapping.GeneralizedFieldHandler, org.exolab.castor.mapping.handlers.TransientFieldHandler, org.exolab.castor.mapping.loader.FieldHandlerImpl, org.exolab.castor.types.CenturyDescriptor.CenturyFieldHandler, org.exolab.castor.types.DateDescriptor.DateFieldHandler, org.exolab.castor.types.DurationDescriptor.DurationFieldHandler, org.exolab.castor.types.GDayDescriptor.GDayFieldHandler, org.exolab.castor.types.GMonthDayDescriptor.GMonthDayFieldHandler, org.exolab.castor.types.GMonthDescriptor.GMonthFieldHandler, org.exolab.castor.types.GYearDescriptor.GYearFieldHandler, org.exolab.castor.types.GYearMonthDescriptor.GYearMonthFieldHandler, org.exolab.castor.types.MonthDescriptor.MonthFieldHandler, org.exolab.castor.types.RecurringDurationDescriptor.RecurringDurationFieldHandler, org.exolab.castor.types.TimeDescriptor.TimeFieldHandler, org.exolab.castor.types.TimeDurationDescriptor.TimeDurationFieldHandler, org.exolab.castor.types.TimePeriodDescriptor.TimePeriodFieldHandler, org.exolab.castor.types.YearDescriptor.YearFieldHandler, org.exolab.castor.xml.handlers.CollectionFieldHandler, org.exolab.castor.xml.handlers.DateFieldHandler, and org.exolab.castor.xml.XMLFieldHandler.
final void org.exolab.castor.mapping.AbstractFieldHandler.setFieldDescriptor | ( | FieldDescriptor | fieldDesc | ) | [protected, virtual] |
Sets the FieldDescriptor that this FieldHander is responsibile for. By setting the FieldDescriptor, it allows the implementation of the FieldHandler methods to obtain information about the field itself. This allows a particular implementation to become more generic and reusable.
fieldDesc | the FieldDescriptor to set |
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
abstract void org.exolab.castor.mapping.AbstractFieldHandler.setValue | ( | Object | object, | |
Object | value | |||
) | throws IllegalStateException, IllegalArgumentException [pure virtual] |
Sets the value of the field on the object.
object | The object | |
value | The new value |
IllegalStateException | The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object IllegalArgumentException The value passed is not of a supported type |
Implements org.exolab.castor.mapping.ExtendedFieldHandler.
Implemented in org.exolab.castor.mapping.GeneralizedFieldHandler, org.exolab.castor.mapping.handlers.TransientFieldHandler, org.exolab.castor.mapping.loader.FieldHandlerImpl, org.exolab.castor.types.CenturyDescriptor.CenturyFieldHandler, org.exolab.castor.types.DateDescriptor.DateFieldHandler, org.exolab.castor.types.DurationDescriptor.DurationFieldHandler, org.exolab.castor.types.GDayDescriptor.GDayFieldHandler, org.exolab.castor.types.GMonthDayDescriptor.GMonthDayFieldHandler, org.exolab.castor.types.GMonthDescriptor.GMonthFieldHandler, org.exolab.castor.types.GYearDescriptor.GYearFieldHandler, org.exolab.castor.types.GYearMonthDescriptor.GYearMonthFieldHandler, org.exolab.castor.types.MonthDescriptor.MonthFieldHandler, org.exolab.castor.types.RecurringDurationDescriptor.RecurringDurationFieldHandler, org.exolab.castor.types.TimeDescriptor.TimeFieldHandler, org.exolab.castor.types.TimeDurationDescriptor.TimeDurationFieldHandler, org.exolab.castor.types.TimePeriodDescriptor.TimePeriodFieldHandler, org.exolab.castor.types.YearDescriptor.YearFieldHandler, org.exolab.castor.xml.handlers.CollectionFieldHandler, org.exolab.castor.xml.handlers.DateFieldHandler, and org.exolab.castor.xml.XMLFieldHandler.