Public Member Functions | Protected Member Functions

org.exolab.castor.mapping.AbstractFieldHandler Class Reference

Inheritance diagram for org.exolab.castor.mapping.AbstractFieldHandler:
org.exolab.castor.mapping.ExtendedFieldHandler org.exolab.castor.mapping.loader.FieldHandlerFriend org.exolab.castor.mapping.FieldHandler org.exolab.castor.mapping.GeneralizedFieldHandler org.exolab.castor.mapping.handlers.TransientFieldHandler org.exolab.castor.mapping.loader.FieldHandlerImpl org.exolab.castor.xml.XMLFieldHandler org.exolab.castor.mapping.handlers.EnumFieldHandler org.exolab.castor.xml.handlers.SQLTimeFieldHandler org.exolab.castor.xml.handlers.SQLTimestampFieldHandler org.exolab.castor.xml.handlers.ValueOfFieldHandler 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

List of all members.

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)

Detailed Description

An extended version of the FieldHandler interface which is used for adding additional functionality while preserving backward compatability.

Author:
Keith Visco
Version:
Revision:
1.4
Date:
2003/09/23 20:44:50
See also:
FieldDescriptor
FieldHandler

Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Returns:
the FieldDescriptor, or null if none exists.

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.

Parameters:
object The object
Returns:
The value of the field
Exceptions:
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.

Returns:
true if the given object has a value for the handled field

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.

Parameters:
parent The object for which the field is created
Returns:
A new instance of the field's value
Exceptions:
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.

Parameters:
parent The object for which the field is created
args the set of constructor arguments
Returns:
A new instance of the field's value
Exceptions:
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.

Parameters:
object The object
Exceptions:
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.

Parameters:
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.

Parameters:
object The object
value The new value
Exceptions:
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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties