assertTrue(componentType != null && !Object.class.equals(componentType), "Invalid paramType: %s",
context.getTypeInfo());
}
public Object resolve() {
Form form = formService.getForm();
// ȡ��ͬ��group instances�е�ָ��field��
Collection<Group> groups = form.getGroups(groupName);
List<Field> fields = new ArrayList<Field>(groups.size());
for (Group group : groups) {
fields.add(group.getField(fieldName));
}
boolean valid = isValidatedAndValid(form);
if (componentType.isAssignableFrom(Field.class)) {
Object result = null;
try {
result = form.getTypeConverter().convertIfNecessary(fields, context.getTypeInfo().getRawType(),
context.getExtraObject(MethodParameter.class));
} catch (TypeMismatchException e) {
if (!isConverterQuiet(form)) {
throw e;
}
return null;
}
skipModuleExecutionIfNecessary(valid, result);
return result;
} else {
skipModuleExecutionIfNecessary(valid, null);
if (!valid) {
return null;
}
Object[] results = new Object[fields.size()];
for (int i = 0; i < results.length; i++) {
try {
results[i] = fields.get(i).getValueOfType(componentType,
context.getExtraObject(MethodParameter.class), null);
} catch (TypeMismatchException e) {
if (!isConverterQuiet(form)) {
throw e;
}
results[i] = null;
}
}
try {
return form.getTypeConverter().convertIfNecessary(results, context.getTypeInfo().getRawType(),
context.getExtraObject(MethodParameter.class));
} catch (TypeMismatchException e) {
if (!isConverterQuiet(form)) {
throw e;
}