org.exolab.castor.mapping.loader
public final class FieldHandlerImpl extends AbstractFieldHandler
Note: the field Java type is obtained from getFieldType, but if the field is a collection, the actual field/accessor type is obtained from TypeInfo and the object to create (with FieldHandlerImpl) is the former field type.
Version: $Revision: 1.2 $ $Date: 2003/04/16 07:15:35 $
Constructor Summary | |
---|---|
FieldHandlerImpl(FieldHandler handler, TypeInfo typeInfo)
Construct a new field handler for the specified field. | |
FieldHandlerImpl(Field field, TypeInfo typeInfo)
Construct a new field handler for the specified field. | |
FieldHandlerImpl(String fieldName, Method[] getSequence, Method[] setSequence, Method getMethod, Method setMethod, TypeInfo typeInfo)
Construct a new field handler for the specified field that
is accessed through the accessor methods (get/set). |
Method Summary | |
---|---|
TypeConvertor | getConvertFrom() |
String | getConvertParam() |
TypeConvertor | getConvertTo() |
Object | getValue(Object object) |
boolean | isCollection()
Return true if the field is a collection. |
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 | setAddMethod(Method method)
Mutator method used by Introspector.
|
void | setConvertFrom(TypeConvertor convertor)
Sets the TypeConvertor used during calls to getValue
|
void | setConvertTo(TypeConvertor convertor)
Sets the TypeConvertor used during calls to setValue
|
void | setCreateMethod(Method method)
Mutator method used by MappingLoader and
Introspector.
|
void | setHasDeleteMethod(Method hasMethod, Method deleteMethod)
Mutator method used by MappingLoader and
Introspector.
|
void | setReadMethod(Method method)
Mutator method used by Introspector.
|
void | setRequired(boolean required)
Mutator method used by MappingLoader. |
void | setValue(Object object, Object value) |
void | setWriteMethod(Method method)
Mutator method used by Introspector.
|
String | toString() |
Parameters: field The field being described typeInfo Type information
Throws: MappingException If the field is not public, is static or transient
Parameters: field The field being described typeInfo Type information
Throws: MappingException If the field is not public, is static or transient
Parameters: fieldName The field being described getMethod The method used to retrieve the field value, must accept no parameters and have a return type castable to the field type setMethod The method used to set the field value, must accept a single paramater that is castable to the field type typeInfo Type information
Throws: MappingException If the get or set method are not public, are static, or do not specify the proper types
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
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
Throws: IllegalStateException This field is a simple type and cannot be instantiated
Parameters: convertor the TypeConvertor to use during calls to getValue
Parameters: convertor the TypeConvertor to use during calls to setValue