org.dozer.util
Class MappingUtils
java.lang.Object
org.dozer.util.MappingUtils
public final class MappingUtils
- extends Object
Internal class that provides various mapping utilities used throughout the code base. Only intended for internal use.
- Author:
- garsombke.franz, sullins.ben, tierney.matt
|
Method Summary |
static void |
applyGlobalCopyByReference(Configuration globalConfig,
FieldMap fieldMap,
ClassMap classMap)
|
static
|
deProxy(T object)
|
static Class<?> |
determineCustomConverter(FieldMap fieldMap,
Cache converterByDestTypeCache,
CustomConverterContainer customConverterContainer,
Class<?> srcClass,
Class<?> destClass)
|
static Class<?> |
findCustomConverter(Cache converterByDestTypeCache,
CustomConverterContainer customConverterContainer,
Class<?> srcClass,
Class<?> destClass)
|
static String |
getClassNameWithoutPackage(Class<?> clazz)
|
static Object |
getIndexedValue(Object collection,
int index)
|
static List<Class<?>> |
getInterfaceHierarchy(Class<?> srcClass)
|
static String |
getMappedParentFieldKey(Object destObj,
FieldMap destFieldMap)
|
static Class<?> |
getRealClass(Class<?> clazz)
|
static Throwable |
getRootCause(Throwable ex)
|
static List<Class<?>> |
getSuperClassesAndInterfaces(Class<?> srcClass)
|
static boolean |
isBlankOrNull(String value)
|
static boolean |
isDeepMapping(String mapping)
|
static boolean |
isEnumType(Class<?> srcFieldClass,
Class<?> destFieldType)
Used to test if both srcFieldClass and destFieldType are enum. |
static boolean |
isProxy(Class<?> clazz)
|
static boolean |
isSupportedCollection(Class<?> aClass)
|
static boolean |
isSupportedMap(Class<?> aClass)
|
static Class<?> |
loadClass(String name)
|
static Object |
prepareIndexedCollection(Class<?> collectionType,
Object existingCollection,
Object collectionEntry,
int index)
|
static void |
reverseFields(ClassMap source,
ClassMap destination)
|
static void |
reverseFields(FieldMap source,
FieldMap reversed)
|
static void |
throwMappingException(String msg)
|
static void |
throwMappingException(String msg,
Throwable cause)
|
static void |
throwMappingException(Throwable e)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getClassNameWithoutPackage
public static String getClassNameWithoutPackage(Class<?> clazz)
isSupportedCollection
public static boolean isSupportedCollection(Class<?> aClass)
isSupportedMap
public static boolean isSupportedMap(Class<?> aClass)
throwMappingException
public static void throwMappingException(Throwable e)
throws MappingException
- Throws:
MappingException
throwMappingException
public static void throwMappingException(String msg)
throws MappingException
- Throws:
MappingException
throwMappingException
public static void throwMappingException(String msg,
Throwable cause)
throws MappingException
- Throws:
MappingException
isBlankOrNull
public static boolean isBlankOrNull(String value)
getRootCause
public static Throwable getRootCause(Throwable ex)
getMappedParentFieldKey
public static String getMappedParentFieldKey(Object destObj,
FieldMap destFieldMap)
findCustomConverter
public static Class<?> findCustomConverter(Cache converterByDestTypeCache,
CustomConverterContainer customConverterContainer,
Class<?> srcClass,
Class<?> destClass)
determineCustomConverter
public static Class<?> determineCustomConverter(FieldMap fieldMap,
Cache converterByDestTypeCache,
CustomConverterContainer customConverterContainer,
Class<?> srcClass,
Class<?> destClass)
reverseFields
public static void reverseFields(FieldMap source,
FieldMap reversed)
reverseFields
public static void reverseFields(ClassMap source,
ClassMap destination)
getIndexedValue
public static Object getIndexedValue(Object collection,
int index)
applyGlobalCopyByReference
public static void applyGlobalCopyByReference(Configuration globalConfig,
FieldMap fieldMap,
ClassMap classMap)
loadClass
public static Class<?> loadClass(String name)
getRealClass
public static Class<?> getRealClass(Class<?> clazz)
deProxy
public static <T> T deProxy(T object)
isProxy
public static boolean isProxy(Class<?> clazz)
prepareIndexedCollection
public static Object prepareIndexedCollection(Class<?> collectionType,
Object existingCollection,
Object collectionEntry,
int index)
isDeepMapping
public static boolean isDeepMapping(String mapping)
isEnumType
public static boolean isEnumType(Class<?> srcFieldClass,
Class<?> destFieldType)
- Used to test if both
srcFieldClass and destFieldType are enum.
- Parameters:
srcFieldClass - the source field to be tested.destFieldType - the destination field to be tested.
- Returns:
true if and only if current running JRE is 1.5 or above, and both
srcFieldClass and destFieldType are enum; otherwise return false.
getSuperClassesAndInterfaces
public static List<Class<?>> getSuperClassesAndInterfaces(Class<?> srcClass)
getInterfaceHierarchy
public static List<Class<?>> getInterfaceHierarchy(Class<?> srcClass)
Copyright © 2005-2011 dozer. All Rights Reserved.