Public Member Functions

org.exolab.castor.mapping.handlers.EnumFieldHandler Class Reference

Inheritance diagram for org.exolab.castor.mapping.handlers.EnumFieldHandler:
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

 EnumFieldHandler (Class enumType, FieldHandler handler, Method createMethod)
Object convertUponGet (Object value)
Object convertUponSet (Object value) throws java.lang.IllegalStateException
Class getFieldType ()
Object newInstance (Object parent) throws IllegalStateException
Object newInstance (Object parent, Object[] args) throws IllegalStateException
boolean equals (Object obj)

Detailed Description

A specialized FieldHandler for the type-safe enum style classes.

Adapted from org.exolab.castor.xml.handlers.EnumFieldHandler which is used for the generated source code.

Author:
Keith Visco
Version:
Revision:
1.1
Date:
2005/01/17 21:35:36

Constructor & Destructor Documentation

org.exolab.castor.mapping.handlers.EnumFieldHandler.EnumFieldHandler ( Class  enumType,
FieldHandler  handler,
Method  createMethod 
)

Creates a new EnumFieldHandler with the given type and FieldHandler

Parameters:
type the Class type of the described field
handler the FieldHandler to delegate to

References org.exolab.castor.mapping.GeneralizedFieldHandler.setFieldHandler().


Member Function Documentation

Object org.exolab.castor.mapping.handlers.EnumFieldHandler.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.mapping.handlers.EnumFieldHandler.convertUponSet ( Object  value  )  throws java.lang.IllegalStateException [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.

boolean org.exolab.castor.mapping.handlers.EnumFieldHandler.equals ( Object  obj  ) 

Returns true if the given object is an XMLFieldHandler that is equivalent to the delegated handler. An equivalent XMLFieldHandler is an XMLFieldHandler that is an instances of the same class.

Returns:
true if the given object is an XMLFieldHandler that is equivalent to this one.
Class org.exolab.castor.mapping.handlers.EnumFieldHandler.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.mapping.handlers.EnumFieldHandler.newInstance ( Object  parent,
Object[]  args 
) throws IllegalStateException [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

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

Object org.exolab.castor.mapping.handlers.EnumFieldHandler.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