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) |
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.
org.exolab.castor.mapping.handlers.EnumFieldHandler.EnumFieldHandler | ( | Class | enumType, | |
FieldHandler | handler, | |||
Method | createMethod | |||
) |
Creates a new EnumFieldHandler with the given type and FieldHandler
type | the Class type of the described field | |
handler | the FieldHandler to delegate to |
References org.exolab.castor.mapping.GeneralizedFieldHandler.setFieldHandler().
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.
value | the object value to convert after performing a get operation |
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.
value | the object value to convert before performing a set operation |
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.
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.
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.
parent | The object for which the field is created | |
args | the set of constructor arguments |
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.
parent | The object for which the field is created |
IllegalStateException | This field is a simple type and cannot be instantiated |
Reimplemented from org.exolab.castor.mapping.GeneralizedFieldHandler.