ConfigurableFieldHandler
, FieldHandler
EnumFieldHandler
, SQLTimeFieldHandler
, SQLTimestampFieldHandler
, ToStringFieldHandler
, ValueOfFieldHandler
public abstract class GeneralizedFieldHandler extends AbstractFieldHandler
FieldDescriptor
,
FieldHandler
Modifier and Type | Class | Description |
---|---|---|
(package private) static class |
GeneralizedFieldHandler.GFHConverterEnumeration |
_properties
Modifier | Constructor | Description |
---|---|---|
protected |
GeneralizedFieldHandler() |
Creates a new default GeneralizedFieldHandler.
|
Modifier and Type | Method | Description |
---|---|---|
abstract java.lang.Object |
convertUponGet(java.lang.Object value) |
This method is used to convert the value when the getValue method
is called.
|
abstract java.lang.Object |
convertUponSet(java.lang.Object value) |
This method is used to convert the value when the setValue method
is called.
|
abstract java.lang.Class |
getFieldType() |
Returns the class type for the field that this GeneralizedFieldHandler
converts to and from.
|
java.lang.Object |
getValue(java.lang.Object object) |
Returns the value of the field from the object.
|
java.lang.Object |
newInstance(java.lang.Object parent) |
Creates a new instance of the object described by this field.
|
java.lang.Object |
newInstance(java.lang.Object parent,
java.lang.Object[] args) |
Creates a new instance of the object described by this field.
|
void |
resetValue(java.lang.Object object) |
Sets the value of the field to a default value.
|
void |
setCollectionIteration(boolean autoCollectionIteration) |
Sets whether or not this GeneralizedFieldHandler should automatically
iterate over the collection returned by the target object and pass
only the items (one by one) to the convertUponGet method.
|
void |
setFieldHandler(FieldHandler handler) |
Sets the FieldHandler that this FieldHander delegates to.
|
void |
setValue(java.lang.Object object,
java.lang.Object value) |
Sets the value of the field on the object.
|
getFieldDescriptor, hasValue, setConfiguration, setFieldDescriptor
checkValidity
checkValidity
protected GeneralizedFieldHandler()
public abstract java.lang.Object convertUponGet(java.lang.Object value)
value
- the object value to convert after performing a get
operationpublic abstract java.lang.Object convertUponSet(java.lang.Object value)
value
- the object value to convert before performing a set
operationpublic abstract java.lang.Class getFieldType()
public final void setFieldHandler(FieldHandler handler)
handler
- the FieldHandler to delegate topublic void setCollectionIteration(boolean autoCollectionIteration)
autoCollectionIteration
- a boolean that when true indicates
that this GeneralizedFieldHandler should automatically iterate over
a collection and pass only collection items to the convertUponGet
method.public final java.lang.Object getValue(java.lang.Object object) throws java.lang.IllegalStateException
getValue
in interface FieldHandler
getValue
in class FieldHandlerFriend
object
- The objectjava.lang.IllegalStateException
- The Java object has changed and
is no longer supported by this handler, or the handler is not
compatiable with the Java objectpublic java.lang.Object newInstance(java.lang.Object parent) throws java.lang.IllegalStateException
newInstance
in interface FieldHandler
newInstance
in class FieldHandlerFriend
parent
- The object for which the field is createdjava.lang.IllegalStateException
- This field is a simple type and
cannot be instantiatedpublic java.lang.Object newInstance(java.lang.Object parent, java.lang.Object[] args) throws java.lang.IllegalStateException
newInstance
in class ExtendedFieldHandler
parent
- The object for which the field is createdargs
- the set of constructor argumentsjava.lang.IllegalStateException
- This field is a simple type and
cannot be instantiatedpublic final void resetValue(java.lang.Object object) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
Reference fields are set to null, primitive fields are set to their default value, collection fields are emptied of all elements.
resetValue
in interface FieldHandler
resetValue
in class FieldHandlerFriend
object
- The objectjava.lang.IllegalStateException
- The Java object has changed and
is no longer supported by this handler, or the handler is not
compatiable with the Java objectjava.lang.IllegalArgumentException
public final void setValue(java.lang.Object object, java.lang.Object value) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
setValue
in interface FieldHandler
setValue
in class FieldHandlerFriend
object
- The object.value
- The new value.java.lang.IllegalStateException
- The Java object has changed and is no longer
supported by this handler, or the handler is not compatiable with the
Java object.java.lang.IllegalArgumentException
- The value passed is not of a supported type.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com