Top Fields Constructors Methods
org.eclipse.persistence.mappings.transformers

public Class MethodBasedFieldTransformer

extends Object
implements FieldTransformer
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.mappings.transformers.FieldTransformer, org.eclipse.persistence.core.mappings.transformers.CoreFieldTransformer, java.io.Serializable
Imports
java.lang.reflect.InvocationTargetException, .Method, java.security.AccessController, .PrivilegedActionException, org.eclipse.persistence.exceptions.DescriptorException, org.eclipse.persistence.internal.helper.ClassConstants, .Helper, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedGetMethodParameterTypes, .PrivilegedMethodInvoker, org.eclipse.persistence.sessions.Session, org.eclipse.persistence.mappings.foundation.AbstractTransformationMapping

Author
mmacivor
Since
10 This class is used to preserve the old method of doing Field Transformations on a transformation mapping. It is used internally when the older API is used on a TransformationMapping, and handles doing invocations on the user's domain class
Version
$Header: MethodBasedFieldTransformer.java 18-sep-2006.16:20:59 gyorke Exp $

Field Summary

Modifier and TypeField and Description
protected transient Method
protected AbstractTransformationMapping
protected String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
buildFieldValue(Object
- an instance of the domain class which contains the attribute
object
,
String
- the name of the field being transformed. Used if the user wants to use this transformer for multiple fields.
fieldName
,
Session
- the current session
session
)

Implements org.eclipse.persistence.mappings.transformers.FieldTransformer.buildFieldValue.

public Class<?>
getFieldType()

Return the Java class type of the field value.

public String
public void
initialize(AbstractTransformationMapping
- the mapping this transformer is associated with.
mapping
)

Implements org.eclipse.persistence.mappings.transformers.FieldTransformer.initialize.

Initialize this transformer.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldTransformationMethodback to summary
protected transient Method fieldTransformationMethod
mappingback to summary
protected AbstractTransformationMapping mapping
methodNameback to summary
protected String methodName

Constructor Detail

MethodBasedFieldTransformerback to summary
public MethodBasedFieldTransformer(String methodName)

Method Detail

buildFieldValueback to summary
public Object buildFieldValue(Object object, String fieldName, Session session)

Implements org.eclipse.persistence.mappings.transformers.FieldTransformer.buildFieldValue.

Parameters
object:Object

Doc from org.eclipse.persistence.mappings.transformers.FieldTransformer.buildFieldValue.

- an instance of the domain class which contains the attribute

fieldName:String

Doc from org.eclipse.persistence.mappings.transformers.FieldTransformer.buildFieldValue.

- the name of the field being transformed. Used if the user wants to use this transformer for multiple fields.

session:Session

Doc from org.eclipse.persistence.mappings.transformers.FieldTransformer.buildFieldValue.

- the current session

Returns:Object

Doc from org.eclipse.persistence.mappings.transformers.FieldTransformer.buildFieldValue.

- The value to be written for the field associated with this transformer

Annotations
@Override
getFieldTypeback to summary
public Class<?> getFieldType()

Return the Java class type of the field value. This uses the method return type.

getMethodNameback to summary
public String getMethodName()
initializeback to summary
public void initialize(AbstractTransformationMapping mapping)

Implements org.eclipse.persistence.mappings.transformers.FieldTransformer.initialize.

Doc from org.eclipse.persistence.mappings.transformers.FieldTransformer.initialize.

Initialize this transformer. Only required if the user needs some special information from the mapping in order to do the transformation

Parameters
mapping:AbstractTransformationMapping

- the mapping this transformer is associated with.

Annotations
@Override
setMethodNameback to summary
public void setMethodName(String name)