public static void validateMappingRequest(Object srcObj, Object destObj) { validateMappingRequest(srcObj); if (destObj == null) { MappingUtils.throwMappingException("Destination object must not be null"); } }
public static Method getMethod(Class<?> clazz, String methodName) { Method result = findMethod(clazz, methodName); if (result == null) { MappingUtils.throwMappingException("No method found for class:" + clazz + " and method name:" + methodName); } return result; }
public String createFieldMappingSuccessMsg(Class<?> srcClass, Class<?> destClass, String srcFieldName, String destFieldName, Object srcFieldValue, Object destFieldValue, String classMapId) { String srcClassStr = MappingUtils.getClassNameWithoutPackage(srcClass); String destClassStr = MappingUtils.getClassNameWithoutPackage(destClass); return "MAPPED: " + srcClassStr + "." + srcFieldName + " --> " + destClassStr + "." + destFieldName + " VALUES: " + getLogOutput(srcFieldValue) + " --> " + getLogOutput(destFieldValue) + " MAPID: " + (classMapId != null ? classMapId : ""); }
private PropertyDescriptor getPropertyDescriptor(HintContainer deepIndexHintContainer) { if (pd == null) { pd = ReflectionUtils.findPropertyDescriptor(clazz, fieldName, deepIndexHintContainer); if (pd == null) { MappingUtils.throwMappingException("Property: '" + fieldName + "' not found in Class: " + clazz); } } return pd; }
private Method findMethod(Class<?> actualClass, String createMethod) { Method method = null; try { method = ReflectionUtils.getMethod(actualClass, createMethod, null); } catch (NoSuchMethodException e) { MappingUtils.throwMappingException(e); } return method; }
public void validate() { if (srcField == null) { MappingUtils.throwMappingException("src field must be specified"); } if (destField == null) { MappingUtils.throwMappingException("dest field must be specified"); } }
ChainedPropertyDescriptor(Class<?> clazz, String fieldName, boolean indexed, int index) { this.indexed = indexed; this.index = index; field = ReflectionUtils.getFieldFromBean(clazz, fieldName); }
/** * Used to test if both {@code srcFieldClass} and {@code destFieldType} are enum. * @param srcFieldClass the source field to be tested. * @param destFieldType the destination field to be tested. * @return {@code true} if and only if current running JRE is 1.5 or above, and both * {@code srcFieldClass} and {@code destFieldType} are enum; otherwise return {@code false}. */ public static boolean isEnumType(Class<?> srcFieldClass, Class<?> destFieldType) { return isEnumType(srcFieldClass) && isEnumType(destFieldType); }
public static void validateMappingRequest(Object srcObj, Class<?> destClass) { validateMappingRequest(srcObj); if (destClass == null) { MappingUtils.throwMappingException("Destination class must not be null"); } }
public static Method getMethod(Class<?> clazz, String methodName) { Method result = findMethod(clazz, methodName); if (result == null) { MappingUtils.throwMappingException("No method found for class:" + clazz + " and method name:" + methodName); } return result; }
private PropertyDescriptor getPropertyDescriptor(HintContainer deepIndexHintContainer) { if (pd == null) { pd = ReflectionUtils.findPropertyDescriptor(clazz, fieldName, deepIndexHintContainer); if (pd == null) { MappingUtils.throwMappingException("Property: " + fieldName + " not found in Class: " + clazz); } } return pd; }
private Method findMethod(Class<?> actualClass, String createMethod) { Method method = null; try { method = ReflectionUtils.getMethod(actualClass, createMethod, null); } catch (NoSuchMethodException e) { MappingUtils.throwMappingException(e); } return method; }
public static String createFieldMappingSuccessMsg(Class<?> srcClass, Class<?> destClass, String srcFieldName, String destFieldName, Object srcFieldValue, Object destFieldValue, String classMapId) { String srcClassStr = MappingUtils.getClassNameWithoutPackage(srcClass); String destClassStr = MappingUtils.getClassNameWithoutPackage(destClass); return "MAPPED: " + srcClassStr + "." + srcFieldName + " --> " + destClassStr + "." + destFieldName + " VALUES: " + getLogOutput(srcFieldValue) + " --> " + getLogOutput(destFieldValue) + " MAPID: " + (classMapId != null ? classMapId : ""); }
public static void validateMappingRequest(Object srcObj) { if (srcObj == null) { MappingUtils.throwMappingException("Source object must not be null"); } }
public static void validateMappingRequest(Object srcObj, Object destObj) { validateMappingRequest(srcObj); if (destObj == null) { MappingUtils.throwMappingException("Destination object must not be null"); } }
public static Method getMethod(Class<?> clazz, String methodName) { Method result = findMethod(clazz, methodName); if (result == null) { MappingUtils.throwMappingException("No method found for class:" + clazz + " and method name:" + methodName); } return result; }
private PropertyDescriptor getPropertyDescriptor(HintContainer deepIndexHintContainer) { if (pd == null) { pd = ReflectionUtils.findPropertyDescriptor(clazz, fieldName, deepIndexHintContainer); if (pd == null) { MappingUtils.throwMappingException("Property: " + fieldName + " not found in Class: " + clazz); } } return pd; }
private Method findMethod(Class<?> actualClass, String createMethod) { Method method = null; try { method = ReflectionUtils.getMethod(actualClass, createMethod, null); } catch (NoSuchMethodException e) { MappingUtils.throwMappingException(e); } return method; }
public static String createFieldMappingSuccessMsg(Class<?> srcClass, Class<?> destClass, String srcFieldName, String destFieldName, Object srcFieldValue, Object destFieldValue, String classMapId) { String srcClassStr = MappingUtils.getClassNameWithoutPackage(srcClass); String destClassStr = MappingUtils.getClassNameWithoutPackage(destClass); return "MAPPED: " + srcClassStr + "." + srcFieldName + " --> " + destClassStr + "." + destFieldName + " VALUES: " + getLogOutput( srcFieldValue) + " --> " + getLogOutput( destFieldValue) + " MAPID: " + (classMapId != null ? classMapId : ""); }
public static void validateMappingRequest(Object srcObj, Class<?> destClass) { validateMappingRequest(srcObj); if (destClass == null) { MappingUtils.throwMappingException("Destination class must not be null"); } }