Package org.springframework.core
Class GenericCollectionTypeResolver
- java.lang.Object
- org.springframework.core.GenericCollectionTypeResolver
@Deprecated public abstract class GenericCollectionTypeResolver extends Object
Deprecated.as of 4.3.6, in favor of directResolvableType
usageHelper 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).
- Since:
- 2.0
- Author:
- Juergen Hoeller, Phillip Webb
- See Also:
ResolvableType
Constructor Summary
Constructors Constructor Description GenericCollectionTypeResolver()
Deprecated.
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Class<?>
getCollectionFieldType(Field collectionField)
Deprecated.Determine the generic element type of the given Collection field.static Class<?>
getCollectionFieldType(Field collectionField, int nestingLevel)
Deprecated.Determine the generic element type of the given Collection field.static Class<?>
getCollectionFieldType(Field collectionField, int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Deprecated.as of 4.0, in favor of usingResolvableType
for arbitrary nesting levelsstatic Class<?>
getCollectionParameterType(MethodParameter methodParam)
Deprecated.Determine the generic element type of the given Collection parameter.static Class<?>
getCollectionReturnType(Method method)
Deprecated.Determine the generic element type of the given Collection return type.static Class<?>
getCollectionReturnType(Method method, int nestingLevel)
Deprecated.Determine the generic element type of the given Collection return type.static Class<?>
getCollectionType(Class<? extends Collection> collectionClass)
Deprecated.Determine the generic element type of the given Collection class (if it declares one through a generic superclass or generic interface).static Class<?>
getMapKeyFieldType(Field mapField)
Deprecated.Determine the generic key type of the given Map field.static Class<?>
getMapKeyFieldType(Field mapField, int nestingLevel)
Deprecated.Determine the generic key type of the given Map field.static Class<?>
getMapKeyFieldType(Field mapField, int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Deprecated.as of 4.0, in favor of usingResolvableType
for arbitrary nesting levelsstatic Class<?>
getMapKeyParameterType(MethodParameter methodParam)
Deprecated.Determine the generic key type of the given Map parameter.static Class<?>
getMapKeyReturnType(Method method)
Deprecated.Determine the generic key type of the given Map return type.static Class<?>
getMapKeyReturnType(Method method, int nestingLevel)
Deprecated.Determine the generic key type of the given Map return type.static Class<?>
getMapKeyType(Class<? extends Map> mapClass)
Deprecated.Determine the generic key type of the given Map class (if it declares one through a generic superclass or generic interface).static Class<?>
getMapValueFieldType(Field mapField)
Deprecated.Determine the generic value type of the given Map field.static Class<?>
getMapValueFieldType(Field mapField, int nestingLevel)
Deprecated.Determine the generic value type of the given Map field.static Class<?>
getMapValueFieldType(Field mapField, int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Deprecated.as of 4.0, in favor of usingResolvableType
for arbitrary nesting levelsstatic Class<?>
getMapValueParameterType(MethodParameter methodParam)
Deprecated.Determine the generic value type of the given Map parameter.static Class<?>
getMapValueReturnType(Method method)
Deprecated.Determine the generic value type of the given Map return type.static Class<?>
getMapValueReturnType(Method method, int nestingLevel)
Deprecated.Determine the generic value type of the given Map return type.static Class<?>
getMapValueType(Class<? extends Map> mapClass)
Deprecated.Determine the generic value type of the given Map class (if it declares one through a generic superclass or generic interface).
Constructor Detail
GenericCollectionTypeResolver
public GenericCollectionTypeResolver()
Deprecated.
Method Detail
getCollectionType
public static Class<?> getCollectionType(Class<? extends Collection> collectionClass)
Deprecated.Determine the generic element type of the given Collection class (if it declares one through a generic superclass or generic interface).- Parameters:
collectionClass
- the collection class to introspect- Returns:
- the generic type, or
null
if none
getMapKeyType
public static Class<?> getMapKeyType(Class<? extends Map> mapClass)
Deprecated.Determine the generic key type of the given Map class (if it declares one through a generic superclass or generic interface).- Parameters:
mapClass
- the map class to introspect- Returns:
- the generic type, or
null
if none
getMapValueType
public static Class<?> getMapValueType(Class<? extends Map> mapClass)
Deprecated.Determine the generic value type of the given Map class (if it declares one through a generic superclass or generic interface).- Parameters:
mapClass
- the map class to introspect- Returns:
- the generic type, or
null
if none
getCollectionFieldType
public static Class<?> getCollectionFieldType(Field collectionField)
Deprecated.Determine the generic element type of the given Collection field.- Parameters:
collectionField
- the collection field to introspect- Returns:
- the generic type, or
null
if none
getCollectionFieldType
public static Class<?> getCollectionFieldType(Field collectionField, int nestingLevel)
Deprecated.Determine the generic element type of the given Collection field.- Parameters:
collectionField
- the collection field to introspectnestingLevel
- 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)- Returns:
- the generic type, or
null
if none
getCollectionFieldType
@Deprecated public static Class<?> getCollectionFieldType(Field collectionField, int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Deprecated.as of 4.0, in favor of usingResolvableType
for arbitrary nesting levelsDetermine the generic element type of the given Collection field.- Parameters:
collectionField
- the collection field to introspectnestingLevel
- 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)typeIndexesPerLevel
- Map keyed by nesting level, with each value expressing the type index for traversal at that level- Returns:
- the generic type, or
null
if none
getMapKeyFieldType
public static Class<?> getMapKeyFieldType(Field mapField)
Deprecated.Determine the generic key type of the given Map field.- Parameters:
mapField
- the map field to introspect- Returns:
- the generic type, or
null
if none
getMapKeyFieldType
public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel)
Deprecated.Determine the generic key type of the given Map field.- Parameters:
mapField
- the map field to introspectnestingLevel
- 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)- Returns:
- the generic type, or
null
if none
getMapKeyFieldType
@Deprecated public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Deprecated.as of 4.0, in favor of usingResolvableType
for arbitrary nesting levelsDetermine the generic key type of the given Map field.- Parameters:
mapField
- the map field to introspectnestingLevel
- 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)typeIndexesPerLevel
- Map keyed by nesting level, with each value expressing the type index for traversal at that level- Returns:
- the generic type, or
null
if none
getMapValueFieldType
public static Class<?> getMapValueFieldType(Field mapField)
Deprecated.Determine the generic value type of the given Map field.- Parameters:
mapField
- the map field to introspect- Returns:
- the generic type, or
null
if none
getMapValueFieldType
public static Class<?> getMapValueFieldType(Field mapField, int nestingLevel)
Deprecated.Determine the generic value type of the given Map field.- Parameters:
mapField
- the map field to introspectnestingLevel
- 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)- Returns:
- the generic type, or
null
if none
getMapValueFieldType
@Deprecated public static Class<?> getMapValueFieldType(Field mapField, int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Deprecated.as of 4.0, in favor of usingResolvableType
for arbitrary nesting levelsDetermine the generic value type of the given Map field.- Parameters:
mapField
- the map field to introspectnestingLevel
- 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)typeIndexesPerLevel
- Map keyed by nesting level, with each value expressing the type index for traversal at that level- Returns:
- the generic type, or
null
if none
getCollectionParameterType
public static Class<?> getCollectionParameterType(MethodParameter methodParam)
Deprecated.Determine the generic element type of the given Collection parameter.- Parameters:
methodParam
- the method parameter specification- Returns:
- the generic type, or
null
if none
getMapKeyParameterType
public static Class<?> getMapKeyParameterType(MethodParameter methodParam)
Deprecated.Determine the generic key type of the given Map parameter.- Parameters:
methodParam
- the method parameter specification- Returns:
- the generic type, or
null
if none
getMapValueParameterType
public static Class<?> getMapValueParameterType(MethodParameter methodParam)
Deprecated.Determine the generic value type of the given Map parameter.- Parameters:
methodParam
- the method parameter specification- Returns:
- the generic type, or
null
if none
getCollectionReturnType
public static Class<?> getCollectionReturnType(Method method)
Deprecated.Determine the generic element type of the given Collection return type.- Parameters:
method
- the method to check the return type for- Returns:
- the generic type, or
null
if none
getCollectionReturnType
public static Class<?> getCollectionReturnType(Method method, int nestingLevel)
Deprecated.Determine the generic element type of the given Collection return type.If the specified nesting level is higher than 1, the element type of a nested Collection/Map will be analyzed.
- Parameters:
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)- Returns:
- the generic type, or
null
if none
getMapKeyReturnType
public static Class<?> getMapKeyReturnType(Method method)
Deprecated.Determine the generic key type of the given Map return type.- Parameters:
method
- the method to check the return type for- Returns:
- the generic type, or
null
if none
getMapKeyReturnType
public static Class<?> getMapKeyReturnType(Method method, int nestingLevel)
Deprecated.Determine the generic key type of the given Map return type.- Parameters:
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)- Returns:
- the generic type, or
null
if none
getMapValueReturnType
public static Class<?> getMapValueReturnType(Method method)
Deprecated.Determine the generic value type of the given Map return type.- Parameters:
method
- the method to check the return type for- Returns:
- the generic type, or
null
if none
getMapValueReturnType
public static Class<?> getMapValueReturnType(Method method, int nestingLevel)
Deprecated.Determine the generic value type of the given Map return type.- Parameters:
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)- Returns:
- the generic type, or
null
if none