EclipseLink 1.1.4, build 'v20100812-r7860' API Reference

org.eclipse.persistence.mappings.converters
Class TypeConversionConverter

java.lang.Object
  extended by org.eclipse.persistence.mappings.converters.TypeConversionConverter
All Implemented Interfaces:
java.io.Serializable, Converter

public class TypeConversionConverter
extends java.lang.Object
implements Converter

Purpose: Type conversion converters are used to explicitly map a database type to a Java type.

See Also:
Serialized Form
Author:
James Sutherland
Since:
OracleAS TopLink 10g (10.0.3)

Field Summary
protected  java.lang.Class dataClass
          Field type
protected  java.lang.String dataClassName
           
protected  DatabaseMapping mapping
           
protected  java.lang.Class objectClass
          Object type
protected  java.lang.String objectClassName
           
 
Constructor Summary
TypeConversionConverter()
          PUBLIC: Default constructor.
TypeConversionConverter(DatabaseMapping mapping)
          PUBLIC: Default constructor.
 
Method Summary
 void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
          INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings.
 java.lang.Object convertDataValueToObjectValue(java.lang.Object fieldValue, Session session)
          INTERNAL: The field value must first be converted to the field type, then the attribute type.
 java.lang.Object convertObjectValueToDataValue(java.lang.Object attributeValue, Session session)
          INTERNAL: Convert to the field class.
 java.lang.Class getDataClass()
          PUBLIC: Returns the class type of the data value.
 java.lang.String getDataClassName()
          INTERNAL: Return the name of the data type for the MW usage.
protected  DatabaseMapping getMapping()
          INTERNAL: Return the mapping.
 java.lang.Class getObjectClass()
          PUBLIC: Returns the class type of the object value.
 java.lang.String getObjectClassName()
          INTERNAL: Return the name of the object type for the MW usage.
 void initialize(DatabaseMapping mapping, Session session)
          INTERNAL: Set the mapping.
 boolean isMutable()
          INTERNAL: If the converter converts the value to a non-atomic value, i.e.
 void setDataClass(java.lang.Class dataClass)
          PUBLIC: Set the class type of the data value.
 void setDataClassName(java.lang.String dataClassName)
          INTERNAL: Set the name of the data type for the MW usage.
 void setObjectClass(java.lang.Class objectClass)
          PUBLIC: Set the class type of the object value.
 void setObjectClassName(java.lang.String objectClassName)
          INTERNAL: Set the name of the object type for the MW usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapping

protected DatabaseMapping mapping

dataClass

protected java.lang.Class dataClass
Field type


dataClassName

protected java.lang.String dataClassName

objectClass

protected java.lang.Class objectClass
Object type


objectClassName

protected java.lang.String objectClassName
Constructor Detail

TypeConversionConverter

public TypeConversionConverter()
PUBLIC: Default constructor.


TypeConversionConverter

public TypeConversionConverter(DatabaseMapping mapping)
PUBLIC: Default constructor.

Method Detail

convertClassNamesToClasses

public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes. This method is implemented by subclasses as necessary.

Parameters:
classLoader -

convertDataValueToObjectValue

public java.lang.Object convertDataValueToObjectValue(java.lang.Object fieldValue,
                                                      Session session)
INTERNAL: The field value must first be converted to the field type, then the attribute type.

Specified by:
convertDataValueToObjectValue in interface Converter

getObjectClass

public java.lang.Class getObjectClass()
PUBLIC: Returns the class type of the object value.


getObjectClassName

public java.lang.String getObjectClassName()
INTERNAL: Return the name of the object type for the MW usage.


getDataClass

public java.lang.Class getDataClass()
PUBLIC: Returns the class type of the data value.


getDataClassName

public java.lang.String getDataClassName()
INTERNAL: Return the name of the data type for the MW usage.


setDataClass

public void setDataClass(java.lang.Class dataClass)
PUBLIC: Set the class type of the data value.


setDataClassName

public void setDataClassName(java.lang.String dataClassName)
INTERNAL: Set the name of the data type for the MW usage.


setObjectClass

public void setObjectClass(java.lang.Class objectClass)
PUBLIC: Set the class type of the object value.


setObjectClassName

public void setObjectClassName(java.lang.String objectClassName)
INTERNAL: Set the name of the object type for the MW usage.


convertObjectValueToDataValue

public java.lang.Object convertObjectValueToDataValue(java.lang.Object attributeValue,
                                                      Session session)
INTERNAL: Convert to the field class.

Specified by:
convertObjectValueToDataValue in interface Converter

initialize

public void initialize(DatabaseMapping mapping,
                       Session session)
INTERNAL: Set the mapping.

Specified by:
initialize in interface Converter

getMapping

protected DatabaseMapping getMapping()
INTERNAL: Return the mapping.


isMutable

public boolean isMutable()
INTERNAL: If the converter converts the value to a non-atomic value, i.e. a value that can have its' parts changed without being replaced, then it must return false, serialization can be non-atomic.

Specified by:
isMutable in interface Converter

EclipseLink 1.1.4, build 'v20100812-r7860' API Reference