Class MappingUtils


  • public final class MappingUtils
    extends Object
    Internal class that provides various mapping utilities used throughout the code base. Only intended for internal use.
    • Method Detail

      • getClassNameWithoutPackage

        public static String getClassNameWithoutPackage​(Class<?> clazz)
      • isSupportedCollection

        public static boolean isSupportedCollection​(Class<?> aClass)
      • isSupportedMap

        public static boolean isSupportedMap​(Class<?> aClass)
      • isBlankOrNull

        public static boolean isBlankOrNull​(String value)
      • getMappedParentFieldKey

        public static String getMappedParentFieldKey​(Object destObj,
                                                     FieldMap destFieldMap)
      • reverseFields

        public static void reverseFields​(FieldMap source,
                                         FieldMap reversed)
      • getIndexedValue

        public static Object getIndexedValue​(Object collection,
                                             int index)
      • applyGlobalCopyByReference

        public static void applyGlobalCopyByReference​(Configuration globalConfig,
                                                      FieldMap fieldMap,
                                                      ClassMap classMap)
      • deProxy

        public static <T> T deProxy​(T object,
                                    BeanContainer beanContainer)
      • isProxy

        public static boolean isProxy​(Class<?> clazz,
                                      BeanContainer beanContainer)
      • 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)
        Used to test if srcFieldClass is enum.
        Parameters:
        srcFieldClass - the source field to be tested.
        Returns:
        true if and only if current running JRE is 1.5 or above, and srcFieldClass is enum; otherwise return false.
      • 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,
                                                                  BeanContainer beanContainer)