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 void mapFromIterateMethodFieldMap(Object srcObj, Object destObj, Object srcFieldValue, FieldMap fieldMapping) { // Iterate over the destFieldValue - iterating is fine unless we are mapping // in the other direction. // Verify that it is truly a collection if it is an iterator object turn it // into a List if (srcFieldValue instanceof Iterator) { srcFieldValue = IteratorUtils.toList((Iterator<?>) srcFieldValue); } if (srcFieldValue != null) { for (int i = 0; i < CollectionUtils.getLengthOfCollection(srcFieldValue); i++) { final Object value = CollectionUtils.getValueFromCollection(srcFieldValue, i); // map this value if (fieldMapping.getDestHintContainer() == null) { MappingUtils.throwMappingException("<field type=\"iterate\"> must have a source or destination type hint"); } Class<?> destinationHint = fieldMapping.getDestHintType(value.getClass()); Object result = mapOrRecurseObject(srcObj, value, destinationHint, fieldMapping, destObj); if (value != null) { writeDestinationValue(destObj, result, fieldMapping, srcObj); } } } if (log.isDebugEnabled()) { log.debug(logMsgFactory.createFieldMappingSuccessMsg(srcObj.getClass(), destObj.getClass(), fieldMapping.getSrcFieldName(), fieldMapping.getDestFieldName(), srcFieldValue, null, fieldMapping.getClassMap().getMapId())); } }
log.error(LogMsgFactory.createFieldMappingErrorMsg(srcObj, fieldMapping, srcFieldValue, destObj), e); statsMgr.increment(StatisticType.FIELD_MAPPING_FAILURE_COUNT);
log.debug(logMsgFactory.createFieldMappingSuccessMsg(srcObj.getClass(), destObj.getClass(), fieldMapping.getSrcFieldName(), fieldMapping.getDestFieldName(), srcFieldValue, destFieldValue, fieldMapping.getClassMap().getMapId()));
log.error(LogMsgFactory.createFieldMappingErrorMsg(srcObj, fieldMapping, srcFieldValue, destObj), e); statsMgr.increment(StatisticType.FIELD_MAPPING_FAILURE_COUNT);
log.debug(LogMsgFactory.createFieldMappingSuccessMsg(srcObj.getClass(), destObj.getClass(), fieldMapping.getSrcFieldName(), fieldMapping.getDestFieldName(), srcFieldValue, destFieldValue, fieldMapping.getMapId()));
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 : ""); }
log.error(logMsgFactory.createFieldMappingErrorMsg(srcObj, fieldMapping, srcFieldValue, destObj), e); statsMgr.increment(StatisticType.FIELD_MAPPING_FAILURE_COUNT);
log.debug(LogMsgFactory.createFieldMappingSuccessMsg(srcObj.getClass(), destObj.getClass(), fieldMapping .getSrcFieldName(), fieldMapping.getDestFieldName(), srcFieldValue, null, fieldMapping.getClassMap() .getMapId()));
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 : ""); }
log.debug(LogMsgFactory.createFieldMappingSuccessMsg(srcObj.getClass(), destObj.getClass(), fieldMapping.getSrcFieldName(),
LogMsgFactory.getLogOutput(srcObj), LogMsgFactory.getLogOutput(destObj), classMap.getSrcClassToMap(), classMap.getDestClassToMap()));
log.debug(LogMsgFactory.createFieldMappingSuccessMsg(srcObj.getClass(), destObj.getClass(), fieldMapping.getSrcFieldName(),
LogMsgFactory.getLogOutput(srcObj), LogMsgFactory.getLogOutput(destObj), classMap.getSrcClassToMap(), classMap.getDestClassToMap()));