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

public Class MethodBasedAttributeTransformer

extends Object
implements AttributeTransformer
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.mappings.transformers.AttributeTransformer, 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.mappings.foundation.AbstractTransformationMapping, org.eclipse.persistence.sessions.DataRecord, .Session

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
Version
$Header: MethodBasedAttributeTransformer.java 18-sep-2006.14:33:54 gyorke Exp $

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Object
buildAttributeValue(DataRecord
- The metadata being used to build the object.
dataRecord
,
Object
- The current object that the attribute is being built for.
object
,
Session
- the current session
session
)

Implements org.eclipse.persistence.mappings.transformers.AttributeTransformer.buildAttributeValue.

INTERNAL: Build the attribute value by invoking the user's transformation method.
public Method
public String
public void
initialize(AbstractTransformationMapping
- The mapping associated with this transformer. Only used if some special information is required.
mapping
)

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

INTERNAL: Initilizes the transformer.
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeTransformationMethodback to summary
protected transient Method attributeTransformationMethod
mappingback to summary
protected AbstractTransformationMapping mapping
methodNameback to summary
protected String methodName

Constructor Detail

MethodBasedAttributeTransformerback to summary
public MethodBasedAttributeTransformer()
MethodBasedAttributeTransformerback to summary
public MethodBasedAttributeTransformer(String methodName)

Method Detail

buildAttributeValueback to summary
public Object buildAttributeValue(DataRecord dataRecord, Object object, Session session)

Implements org.eclipse.persistence.mappings.transformers.AttributeTransformer.buildAttributeValue.

INTERNAL: Build the attribute value by invoking the user's transformation method.

Parameters
dataRecord:DataRecord

Doc from org.eclipse.persistence.mappings.transformers.AttributeTransformer.buildAttributeValue.

- The metadata being used to build the object.

object:Object

Doc from org.eclipse.persistence.mappings.transformers.AttributeTransformer.buildAttributeValue.

- The current object that the attribute is being built for.

session:Session

Doc from org.eclipse.persistence.mappings.transformers.AttributeTransformer.buildAttributeValue.

- the current session

Returns:Object

Doc from org.eclipse.persistence.mappings.transformers.AttributeTransformer.buildAttributeValue.

- The attribute value to be built into the object containing this mapping.

Annotations
@Override
getAttributeTransformationMethodback to summary
public Method getAttributeTransformationMethod()
getMethodNameback to summary
public String getMethodName()
initializeback to summary
public void initialize(AbstractTransformationMapping mapping)

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

INTERNAL: Initilizes the transformer. Looks up the transformation method on the domain class using reflection. This method can have either 1 or 2 parameters.

Parameters
mapping:AbstractTransformationMapping

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

- The mapping associated with this transformer. Only used if some special information is required.

Annotations
@Override
setAttributeTransformationMethodback to summary
public void setAttributeTransformationMethod(Method theMethod)
setMethodNameback to summary
public void setMethodName(String name)