EclipseLink 1.2.0, build 'v20091016-r5565' API Reference

org.eclipse.persistence.mappings.transformers
Class MethodBasedAttributeTransformer

java.lang.Object
  extended by org.eclipse.persistence.mappings.transformers.MethodBasedAttributeTransformer
All Implemented Interfaces:
java.io.Serializable, AttributeTransformer

public class MethodBasedAttributeTransformer
extends java.lang.Object
implements AttributeTransformer

Version:
$Header: /cvsroot/org.eclipse/www/eclipselink/api/1.2/org/eclipse/persistence/mappings/transformers/MethodBasedAttributeTransformer.html,v 1.1 2009/10/23 17:08:19 pkrogh Exp $
See Also:
Serialized Form
Author:
mmacivor
Since:
release specific (what release of product did this appear in) This class is used to preserve the old method of doing Attribute 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

Field Summary
protected  java.lang.reflect.Method attributeTransformationMethod
           
protected  AbstractTransformationMapping mapping
           
protected  java.lang.String methodName
           
 
Constructor Summary
MethodBasedAttributeTransformer()
           
MethodBasedAttributeTransformer(java.lang.String methodName)
           
 
Method Summary
 java.lang.Object buildAttributeValue(Record record, java.lang.Object object, Session session)
          INTERNAL: Build the attribute value by invoking the user's transformation method.
 java.lang.reflect.Method getAttributeTransformationMethod()
           
 java.lang.String getMethodName()
           
 void initialize(AbstractTransformationMapping mapping)
          INTERNAL: Initilizes the transformer.
 void setAttributeTransformationMethod(java.lang.reflect.Method theMethod)
           
 void setMethodName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributeTransformationMethod

protected transient java.lang.reflect.Method attributeTransformationMethod

mapping

protected AbstractTransformationMapping mapping

methodName

protected java.lang.String methodName
Constructor Detail

MethodBasedAttributeTransformer

public MethodBasedAttributeTransformer()

MethodBasedAttributeTransformer

public MethodBasedAttributeTransformer(java.lang.String methodName)
Method Detail

getMethodName

public java.lang.String getMethodName()

setMethodName

public void setMethodName(java.lang.String name)

getAttributeTransformationMethod

public java.lang.reflect.Method getAttributeTransformationMethod()

setAttributeTransformationMethod

public void setAttributeTransformationMethod(java.lang.reflect.Method theMethod)

initialize

public void initialize(AbstractTransformationMapping mapping)
INTERNAL: Initilizes the transformer. Looks up the transformation method on the domain class using reflection. This method can have either 1 or 2 parameters.

Specified by:
initialize in interface AttributeTransformer
Parameters:
mapping - - The mapping associated with this transformer. Only used if some special information is required.

buildAttributeValue

public java.lang.Object buildAttributeValue(Record record,
                                            java.lang.Object object,
                                            Session session)
INTERNAL: Build the attribute value by invoking the user's transformation method.

Specified by:
buildAttributeValue in interface AttributeTransformer
Parameters:
record - - The metadata being used to build the object.
object - - The current object that the attribute is being built for.
session - - the current session
Returns:
- The attribute value to be built into the object containing this mapping.

EclipseLink 1.2.0, build 'v20091016-r5565' API Reference