org.exolab.castor.xml

Class XMLFieldHandler

Implemented Interfaces:
FieldHandler
Known Direct Subclasses:
CenturyDescriptor.CenturyFieldHandler, CollectionFieldHandler, DateDescriptor.DateFieldHandler, DateFieldHandler, DurationDescriptor.DurationFieldHandler, GDayDescriptor.GDayFieldHandler, GMonthDayDescriptor.GMonthDayFieldHandler, GMonthDescriptor.GMonthFieldHandler, GYearDescriptor.GYearFieldHandler, GYearMonthDescriptor.GYearMonthFieldHandler, MonthDescriptor.MonthFieldHandler, RecurringDurationDescriptor.RecurringDurationFieldHandler, TimeDescriptor.TimeFieldHandler, TimeDurationDescriptor.TimeDurationFieldHandler, TimePeriodDescriptor.TimePeriodFieldHandler, YearDescriptor.YearFieldHandler

public class XMLFieldHandler
extends AbstractFieldHandler

This FieldHandler is used in the generated descriptors.

A field handler knows how to perform various operations on the field that require access to the field value.

Version:
$Revision: 6216 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
Authors:
Assaf Arkin
Keith Visco
See Also:
FieldDescriptor

Constructor Summary

XMLFieldHandler()
Creates a new default XMLFieldHandler

Method Summary

boolean
equals(Object obj)
Returns true if the given object is an XMLFieldHandler that is equivalent to this one.
Object
getValue(Object object)
Returns the value of the field from the object.
Object
newInstance(Object parent)
Creates a new instance of the object described by this field.
Object
newInstance(Object parent, Object[] args)
Creates a new instance of the object described by this field.
void
resetValue(Object object)
void
setValue(Object object, Object value)
Sets the value of the field on the object.

Methods inherited from class org.exolab.castor.mapping.AbstractFieldHandler

getFieldDescriptor, getValue, hasValue, newInstance, newInstance, resetValue, setFieldDescriptor, setValue

Methods inherited from class org.exolab.castor.mapping.ExtendedFieldHandler

checkValidity, getFieldDescriptor, getValue, newInstance, newInstance, resetValue, setFieldDescriptor, setValue

Methods inherited from class org.exolab.castor.mapping.loader.FieldHandlerFriend

checkValidity, getFieldDescriptor, getValue, newInstance, resetValue, setFieldDescriptor, setValue

Constructor Details

XMLFieldHandler

public XMLFieldHandler()
Creates a new default XMLFieldHandler

Method Details

equals

public boolean equals(Object obj)
Returns true if the given object is an XMLFieldHandler that is equivalent to this one. An equivalent XMLFieldHandler is an XMLFieldHandler that is an instances of the same class. This method can be overwritten to provide more advanced equivalence tests.
Returns:
true if the given object is an XMLFieldHandler that is equivalent to this one.

getValue

public Object getValue(Object object)
            throws IllegalStateException
Returns the value of the field from the object.
Specified by:
getValue in interface FieldHandler
Overrides:
getValue in interface AbstractFieldHandler
Parameters:
object - The object
Returns:
The value of the field

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

newInstance

public Object newInstance(Object parent,
                          Object[] args)
            throws IllegalStateException
Creates a new instance of the object described by this field.
Overrides:
newInstance in interface AbstractFieldHandler
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

resetValue

public void resetValue(Object object)
            throws IllegalStateException,
                   IllegalArgumentException
Specified by:
resetValue in interface FieldHandler
Overrides:
resetValue in interface AbstractFieldHandler

setValue

public void setValue(Object object,
                     Object value)
            throws IllegalStateException,
                   IllegalArgumentException
Sets the value of the field on the object.
Specified by:
setValue in interface FieldHandler
Overrides:
setValue in interface AbstractFieldHandler
Parameters:
object - The object.
value - The new value.

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com