|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.GenericCollectionTypeResolver
public abstract class GenericCollectionTypeResolver
Helper class for determining element types of collections and maps.
Mainly intended for usage within the framework, determining the target type of values to be added to a collection or map (to be able to attempt type conversion if appropriate).
Only usable on Java 5. Use an appropriate JdkVersion check before calling this class, if a fallback for JDK 1.3/1.4 is desirable.
BeanWrapperImpl
,
JdkVersion
Constructor Summary | |
---|---|
GenericCollectionTypeResolver()
|
Method Summary | |
---|---|
static Class |
getCollectionParameterType(MethodParameter methodParam)
Determine the generic element type of the given Collection parameter. |
static Class |
getCollectionReturnType(Method method)
Determine the generic element type of the given Collection return type. |
static Class |
getCollectionReturnType(Method method,
int nestingLevel)
Determine the generic element type of the given Collection return type. |
static Class |
getCollectionType(Class collectionClass)
Determine the generic element type of the given Collection class (if it declares one through a generic superclass or generic interface). |
static Class |
getMapKeyParameterType(MethodParameter methodParam)
Determine the generic key type of the given Map parameter. |
static Class |
getMapKeyReturnType(Method method)
Determine the generic key type of the given Map parameter. |
static Class |
getMapKeyReturnType(Method method,
int nestingLevel)
Determine the generic key type of the given Map parameter. |
static Class |
getMapKeyType(Class mapClass)
Determine the generic key type of the given Map class (if it declares one through a generic superclass or generic interface). |
static Class |
getMapValueParameterType(MethodParameter methodParam)
Determine the generic value type of the given Map parameter. |
static Class |
getMapValueReturnType(Method method)
Determine the generic value type of the given Map parameter. |
static Class |
getMapValueReturnType(Method method,
int nestingLevel)
Determine the generic value type of the given Map parameter. |
static Class |
getMapValueType(Class mapClass)
Determine the generic value type of the given Map class (if it declares one through a generic superclass or generic interface). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericCollectionTypeResolver()
Method Detail |
---|
public static Class getCollectionType(Class collectionClass)
collectionClass
- the collection class to introspect
null
if nonepublic static Class getMapKeyType(Class mapClass)
mapClass
- the map class to introspect
null
if nonepublic static Class getMapValueType(Class mapClass)
mapClass
- the map class to introspect
null
if nonepublic static Class getCollectionParameterType(MethodParameter methodParam)
methodParam
- the method parameter specification
null
if nonepublic static Class getMapKeyParameterType(MethodParameter methodParam)
methodParam
- the method parameter specification
null
if nonepublic static Class getMapValueParameterType(MethodParameter methodParam)
methodParam
- the method parameter specification
null
if nonepublic static Class getCollectionReturnType(Method method)
method
- the method to check the return type for
null
if nonepublic static Class getCollectionReturnType(Method method, int nestingLevel)
If the specified nesting level is higher than 1, the element type of a nested Collection/Map will be analyzed.
method
- the method to check the return type fornestingLevel
- the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
null
if nonepublic static Class getMapKeyReturnType(Method method)
method
- the method to check the return type for
null
if nonepublic static Class getMapKeyReturnType(Method method, int nestingLevel)
method
- the method to check the return type fornestingLevel
- the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
null
if nonepublic static Class getMapValueReturnType(Method method)
method
- the method to check the return type for
null
if nonepublic static Class getMapValueReturnType(Method method, int nestingLevel)
method
- the method to check the return type fornestingLevel
- the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
null
if none
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |