Public Member Functions

org.exolab.castor.xml.handlers.ValueOfFieldHandler Class Reference

Inheritance diagram for org.exolab.castor.xml.handlers.ValueOfFieldHandler:
org.exolab.castor.mapping.GeneralizedFieldHandler org.exolab.castor.mapping.AbstractFieldHandler org.exolab.castor.mapping.ExtendedFieldHandler org.exolab.castor.mapping.loader.FieldHandlerFriend org.exolab.castor.mapping.FieldHandler

List of all members.

Public Member Functions

 ValueOfFieldHandler (Class type) throws MappingException
Object convertUponGet (Object value)
Object convertUponSet (Object value)
Class getFieldType ()
Object newInstance (Object parent) throws IllegalStateException

Detailed Description

An implementation of GeneralizedFieldHandler for classes that have a built-in valueOf(String) factory method, such as type-safe enumeration classes, java.sql.Timestamp, etc.

Author:
Keith Visco
Version:
Revision:
1.3
Date:
2004/10/01 13:25:18
See also:
FieldDescriptor
FieldHandler

Constructor & Destructor Documentation

org.exolab.castor.xml.handlers.ValueOfFieldHandler.ValueOfFieldHandler ( Class  type  )  throws MappingException

Creates a new ValueOfFieldHandler

Parameters:
type the class type to create the FieldHandler for

Member Function Documentation

Object org.exolab.castor.xml.handlers.ValueOfFieldHandler.convertUponGet ( Object  value  )  [virtual]

This method is used to convert the value when the getValue method is called. The getValue method will obtain the actual field value from given 'parent' object. This convert method is then invoked with the field's value. The value returned from this method will be the actual value returned by getValue method.

Parameters:
value the object value to convert after performing a get operation
Returns:
the converted value.

Implements org.exolab.castor.mapping.GeneralizedFieldHandler.

Object org.exolab.castor.xml.handlers.ValueOfFieldHandler.convertUponSet ( Object  value  )  [virtual]

This method is used to convert the value when the setValue method is called. The setValue method will call this method to obtain the converted value. The converted value will then be used as the value to set for the field.

Parameters:
value the object value to convert before performing a set operation
Returns:
the converted value.

Implements org.exolab.castor.mapping.GeneralizedFieldHandler.

Class org.exolab.castor.xml.handlers.ValueOfFieldHandler.getFieldType (  )  [virtual]

Returns the class type for the field that this GeneralizedFieldHandler converts to and from. This should be the type that is used in the object model.

Returns:
the class type of of the field

Implements org.exolab.castor.mapping.GeneralizedFieldHandler.

Object org.exolab.castor.xml.handlers.ValueOfFieldHandler.newInstance ( Object  parent  )  throws IllegalStateException [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

Reimplemented from org.exolab.castor.mapping.GeneralizedFieldHandler.


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