- java.lang.Object
-
- org.eclipse.persistence.sdo.helper.InstanceClassConverter
-
- All Implemented Interfaces:
Serializable,CoreConverter<DatabaseMapping,Session>,Converter
public class InstanceClassConverter extends Object implements Converter
Purpose: A converter used in conjunction with sdoJava:instanceClass The customClass on the converter must be set and that class must have a Constructor that takes a String argument and a toString method. Used when the javaClass open content property is set.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstanceClassConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectconvertDataValueToObjectValue(Object dataValue, Session session)Convert the value from XML as required during unmarshalObjectconvertObjectValueToDataValue(Object objectValue, Session session)Convert the value as required during marshal.Class<?>getCustomClass()voidinitialize(DatabaseMapping mapping, Session session)PUBLIC: Allow for any initialization.booleanisMutable()PUBLIC: If the converter converts the value to a mutable value, i.e.voidsetCustomClass(Class<?> customClass)
-
-
-
Method Detail
-
convertObjectValueToDataValue
public Object convertObjectValueToDataValue(Object objectValue, Session session)
Convert the value as required during marshal.- Specified by:
convertObjectValueToDataValuein interfaceConverter- Specified by:
convertObjectValueToDataValuein interfaceCoreConverter<DatabaseMapping,Session>- Parameters:
objectValue-session-- Returns:
- String value of the given object value, value returned from objectValue.toString
-
convertDataValueToObjectValue
public Object convertDataValueToObjectValue(Object dataValue, Session session)
Convert the value from XML as required during unmarshal- Specified by:
convertDataValueToObjectValuein interfaceConverter- Specified by:
convertDataValueToObjectValuein interfaceCoreConverter<DatabaseMapping,Session>- Parameters:
dataValue-session-- Returns:
- Convert the value from XML by invoking the constructor that takes a spring parameter
-
isMutable
public boolean isMutable()
Description copied from interface:ConverterPUBLIC: If the converter converts the value to a mutable value, i.e. a value that can have its' parts changed without being replaced, then it must return true. If the value is not mutable, cannot be changed without replacing the whole value then false must be returned. This is used within the UnitOfWork to determine how to clone.
-
initialize
public void initialize(DatabaseMapping mapping, Session session)
Description copied from interface:ConverterPUBLIC: Allow for any initialization.- Specified by:
initializein interfaceConverter- Specified by:
initializein interfaceCoreConverter<DatabaseMapping,Session>
-
setCustomClass
public void setCustomClass(Class<?> customClass)
-
getCustomClass
public Class<?> getCustomClass()
-
-