public class ConversionManager extends CoreConversionManager implements Serializable, Cloneable
Purpose: Contains the conversion routines for some common classes in the system. Primarily used to convert objects from a given database type to a different type in Java. Uses a singleton instance, this is also used from the platform.
Responsibilities:
Constructor and Description |
---|
ConversionManager() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
INTERNAL:
|
Class |
convertClassNameToClass(String className)
PUBLIC:
Resolve the given String className into a class using this
ConversionManager's classloader.
|
Object |
convertObject(Object sourceObject,
Class javaClass)
Convert the object to the appropriate type by invoking the appropriate
ConversionManager method
|
Vector |
getDataTypesConvertedFrom(Class javaClass)
PUBLIC:
Return the list of Classes that can be converted to from the passed in javaClass.
|
Vector |
getDataTypesConvertedTo(Class javaClass)
PUBLIC:
Return the list of Classes that can be converted from to the passed in javaClass.
|
static ClassLoader |
getDefaultLoader()
INTERNAL:
Get the default class loader to use if no instance-level loader is set
|
static ConversionManager |
getDefaultManager()
A singleton conversion manager is used to handle generic conversions.
|
Object |
getDefaultNullValue(Class theClass)
INTERNAL:
Allow for the null values for classes to be defaulted in one place.
|
Map |
getDefaultNullValues()
INTERNAL:
Allow for the null values for classes to be defaulted in one place.
|
ClassLoader |
getLoader()
INTERNAL:
|
static Class |
getObjectClass(Class javaClass)
INTERNAL:
This is used to determine the wrapper class for a primitive.
|
static Class |
getPrimitiveClass(String classType)
INTERNAL:
Returns a class based on the passed in string.
|
boolean |
hasDefaultNullValues()
INTERNAL
|
static Class |
loadClass(String className)
INTERNAL:
Load the class using the default managers class loader.
|
static void |
setDefaultLoader(ClassLoader classLoader)
INTERNAL:
Set the default class loader to use if no instance-level loader is set
|
static void |
setDefaultManager(ConversionManager theManager)
A singleton conversion manager is used to handle generic conversions.
|
void |
setDefaultNullValue(Class theClass,
Object theValue)
INTERNAL:
Allow for the null values for classes to be defaulted in one place.
|
void |
setDefaultNullValues(Map defaultNullValues)
INTERNAL:
Allow for the null values for classes to be defaulted in one place.
|
void |
setLoader(ClassLoader classLoader)
INTERNAL:
|
void |
setShouldUseClassLoaderFromCurrentThread(boolean useCurrentThread)
ADVANCED:
This flag should be set if the current thread classLoader should be used.
|
boolean |
shouldUseClassLoaderFromCurrentThread()
ADVANCED:
This flag should be set if the current thread classLoader should be used.
|
public Object convertObject(Object sourceObject, Class javaClass) throws ConversionException
convertObject
in class CoreConversionManager
object
- - the object that must be convertedjavaClass
- - the class that the object must be converted to-
- ConversionException, all exceptions will be thrown as this type.ConversionException
public Class convertClassNameToClass(String className) throws ConversionException
ConversionException
public static ConversionManager getDefaultManager()
public Object getDefaultNullValue(Class theClass)
public Map getDefaultNullValues()
public ClassLoader getLoader()
getLoader
in class CoreConversionManager
public boolean hasDefaultNullValues()
public static Class loadClass(String className)
public static Class getObjectClass(Class javaClass)
public static Class getPrimitiveClass(String classType)
public static void setDefaultManager(ConversionManager theManager)
public void setDefaultNullValue(Class theClass, Object theValue)
public void setDefaultNullValues(Map defaultNullValues)
public void setLoader(ClassLoader classLoader)
public static void setDefaultLoader(ClassLoader classLoader)
public static ClassLoader getDefaultLoader()
public void setShouldUseClassLoaderFromCurrentThread(boolean useCurrentThread)
public boolean shouldUseClassLoaderFromCurrentThread()
public Vector getDataTypesConvertedFrom(Class javaClass)
javaClass
- - the class that is converted fromEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference