Source:
private Object getValueForProperty(PropertyDescriptor propertyDescriptor, EDBObject object) { Method setterMethod = propertyDescriptor.getWriteMethod(); String propertyName = propertyDescriptor.getName(); Object value = object.getObject(propertyName); Class<?> parameterType = setterMethod.getParameterTypes()[0]; if (object.containsKey(propertyName + ".0.key")) { List<Class<?>> classes = getGenericMapParameterClasses(setterMethod); value = getMapValue(classes.get(0), classes.get(1), propertyName, object); } else if (object.containsKey(propertyName + ".0")) { Class<?> clazz = getGenericListParameterClass(setterMethod); value = getListValue(clazz, propertyName, object); } else if (value == null) { return null; } else if (OpenEngSBModel.class.isAssignableFrom(parameterType)) { EDBObject obj = edbService.getObject((String) value); value = convertEDBObjectToUncheckedModel(parameterType, obj); object.remove(propertyName); } else if (parameterType.equals(FileWrapper.class)) { FileWrapper wrapper = new FileWrapper(); String filename = object.getString(propertyName + ".filename"); String content = (String) value; wrapper.setFilename(filename); wrapper.setContent(Base64.decodeBase64(content)); value = wrapper; object.remove(propertyName + ".filename"); } else if (parameterType.equals(File.class)) { return null; } else if (object.containsKey(propertyName)) { if (parameterType.isEnum()) { value = getEnumValue(parameterType, value); } else if (Number.class.isAssignableFrom(parameterType)) { value = NumberUtils.createNumber((String) value); } } object.remove(propertyName); return value; }

Target:
private Object getValueForProperty(PropertyDescriptor propertyDescriptor, EDBObject object) { Method setterMethod = propertyDescriptor.getWriteMethod(); String propertyName = propertyDescriptor.getName(); Object value = object.getObject(propertyName); Class<?> parameterType = setterMethod.getParameterTypes()[0]; if (Map.class.isAssignableFrom(parameterType)) { List<Class<?>> classes = getGenericMapParameterClasses(setterMethod); value = getMapValue(classes.get(0), classes.get(1), propertyName, object); } else if (List.class.isAssignableFrom(parameterType)) { Class<?> clazz = getGenericListParameterClass(setterMethod); value = getListValue(clazz, propertyName, object); } else if (value == null) { return null; } else if (OpenEngSBModel.class.isAssignableFrom(parameterType)) { EDBObject obj = edbService.getObject((String) value); value = convertEDBObjectToUncheckedModel(parameterType, obj); object.remove(propertyName); } else if (parameterType.equals(FileWrapper.class)) { FileWrapper wrapper = new FileWrapper(); String filename = object.getString(propertyName + EDBConverterUtils.FILEWRAPPER_FILENAME_SUFFIX); String content = (String) value; wrapper.setFilename(filename); wrapper.setContent(Base64.decodeBase64(content)); value = wrapper; object.remove(propertyName + EDBConverterUtils.FILEWRAPPER_FILENAME_SUFFIX); } else if (parameterType.equals(File.class)) { return null; } else if (object.containsKey(propertyName)) { if (parameterType.isEnum()) { value = getEnumValue(parameterType, value); } else if (Number.class.isAssignableFrom(parameterType)) { value = NumberUtils.createNumber((String) value); } } object.remove(propertyName); return value; }