generified TypeConverter interface

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1150 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-05-11 22:44:33 +00:00
parent f6e5c1768e
commit ca0a5b63ff
5 changed files with 28 additions and 27 deletions
@@ -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);
}