public class MethodBasedFieldTransformer extends java.lang.Object implements FieldTransformer
Modifier and Type | Field and Description |
---|---|
protected java.lang.reflect.Method |
fieldTransformationMethod |
protected AbstractTransformationMapping |
mapping |
protected java.lang.String |
methodName |
BUILD_FIELD_VALUE_METHOD
Constructor and Description |
---|
MethodBasedFieldTransformer(java.lang.String methodName) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
buildFieldValue(java.lang.Object object,
java.lang.String fieldName,
Session session) |
java.lang.Class |
getFieldType()
Return the Java class type of the field value.
|
java.lang.String |
getMethodName() |
void |
initialize(AbstractTransformationMapping mapping)
Initialize this transformer.
|
void |
setMethodName(java.lang.String name) |
protected transient java.lang.reflect.Method fieldTransformationMethod
protected java.lang.String methodName
protected AbstractTransformationMapping mapping
public MethodBasedFieldTransformer(java.lang.String methodName)
public void initialize(AbstractTransformationMapping mapping)
FieldTransformer
initialize
in interface FieldTransformer
mapping
- - the mapping this transformer is associated with.public java.lang.Class getFieldType()
public java.lang.Object buildFieldValue(java.lang.Object object, java.lang.String fieldName, Session session)
buildFieldValue
in interface CoreFieldTransformer<Session>
buildFieldValue
in interface FieldTransformer
object
- - an instance of the domain class which contains the attributefieldName
- - the name of the field being transformed. Used if the user wants to use this transformer for multiple fields.session
- - the current sessionpublic java.lang.String getMethodName()
public void setMethodName(java.lang.String name)