generified TypeConverter interface

This commit is contained in:
Juergen Hoeller
2009-05-11 22:44:33 +00:00
parent b72af54f53
commit 0297116542
5 changed files with 28 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -445,12 +445,12 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
return getPropertyEditorRegistry().findCustomEditor(requiredType, propertyPath);
}
public Object convertIfNecessary(Object value, Class requiredType) throws TypeMismatchException {
public <T> T convertIfNecessary(Object value, Class<T> requiredType) throws TypeMismatchException {
return getTypeConverter().convertIfNecessary(value, requiredType);
}
public Object convertIfNecessary(
Object value, Class requiredType, MethodParameter methodParam) throws TypeMismatchException {
public <T> T convertIfNecessary(
Object value, Class<T> requiredType, MethodParameter methodParam) throws TypeMismatchException {
return getTypeConverter().convertIfNecessary(value, requiredType, methodParam);
}