forNestedType usage clarification

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3873 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2011-01-06 18:33:50 +00:00
parent b8d53d2ba7
commit 66814f1235
4 changed files with 41 additions and 17 deletions
@@ -935,7 +935,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
oldValue = Array.get(propValue, arrayIndex);
}
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType,
PropertyTypeDescriptor.forNestedType(requiredType, new MethodParameter(pd.getReadMethod(), -1), pd));
PropertyTypeDescriptor.forNestedType(requiredType, new MethodParameter(pd.getReadMethod(), -1, tokens.keys.length), pd));
Array.set(propValue, arrayIndex, convertedValue);
}
catch (IndexOutOfBoundsException ex) {
@@ -953,9 +953,8 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
if (isExtractOldValueForEditor() && index < list.size()) {
oldValue = list.get(index);
}
// TODO method parameter nesting level should be token.keys.length + 1
Object convertedValue = convertIfNecessary(propertyName, oldValue, pv.getValue(), requiredType,
PropertyTypeDescriptor.forNestedType(requiredType, new MethodParameter(pd.getReadMethod(), -1), pd));
PropertyTypeDescriptor.forNestedType(requiredType, new MethodParameter(pd.getReadMethod(), -1, tokens.keys.length), pd));
if (index < list.size()) {
list.set(index, convertedValue);
}
@@ -994,7 +993,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
// TODO method parameter nesting level should be token.keys.length + 1
Object convertedMapValue = convertIfNecessary(
propertyName, oldValue, pv.getValue(), mapValueType,
PropertyTypeDescriptor.forNestedType(mapValueType, new MethodParameter(pd.getReadMethod(), -1), pd));
PropertyTypeDescriptor.forNestedType(mapValueType, new MethodParameter(pd.getReadMethod(), -1, tokens.keys.length), pd));
map.put(convertedMapKey, convertedMapValue);
}
else {