org.springframework.core.convert.support
Class PropertyTypeDescriptor
java.lang.Object
org.springframework.core.convert.TypeDescriptor
org.springframework.core.convert.support.PropertyTypeDescriptor
public class PropertyTypeDescriptor
- extends TypeDescriptor
TypeDescriptor extension that exposes additional annotations
as conversion metadata: namely, annotations on other accessor methods
(getter/setter) and on the underlying field, if found.
- Since:
- 3.0.2
- Author:
- Juergen Hoeller, Keith Donald
| Methods inherited from class org.springframework.core.convert.TypeDescriptor |
applyIndexedObject, asString, equals, forNestedType, forNestedType, forObject, getAnnotation, getAnnotations, getElementType, getElementTypeDescriptor, getMapKeyType, getMapKeyTypeDescriptor, getMapValueType, getMapValueTypeDescriptor, getMethodParameter, getName, getObjectType, getType, hashCode, isArray, isAssignableTo, isCollection, isMap, isPrimitive, resolveNestedType, toString, valueOf |
PropertyTypeDescriptor
public PropertyTypeDescriptor(MethodParameter methodParameter,
PropertyDescriptor propertyDescriptor)
- Create a new type descriptor for the given bean property.
- Parameters:
methodParameter - the target method parameterpropertyDescriptor - the corresponding JavaBean PropertyDescriptor
forNestedType
public static PropertyTypeDescriptor forNestedType(MethodParameter methodParameter,
PropertyDescriptor propertyDescriptor)
- Create a new type descriptor for a nested type declared on an array, collection, or map-based property.
Use this factory method when you've resolved a nested source object such as a collection element or map value and wish to have it converted.
Builds in protection for increasing the nesting level of the provided MethodParameter if the nestedType is itself a collection.
- Parameters:
methodParameter - the method parameter
- Returns:
- the property descriptor
forNestedType
public static PropertyTypeDescriptor forNestedType(Class<?> nestedType,
MethodParameter methodParameter,
PropertyDescriptor propertyDescriptor)
- Create a new type descriptor for a nested type declared on an array, collection, or map-based property.
Use this factory method when you've resolved a nested source object such as a collection element or map value and wish to have it converted.
Builds in protection for increasing the nesting level of the provided MethodParameter if the nestedType is itself a collection.
- Parameters:
nestedType - the nested typemethodParameter - the method parameter
- Returns:
- the property descriptor
getPropertyDescriptor
public PropertyDescriptor getPropertyDescriptor()
- Return the underlying PropertyDescriptor.
resolveAnnotations
protected Annotation[] resolveAnnotations()
- Overrides:
resolveAnnotations in class TypeDescriptor
newNestedTypeDescriptor
protected TypeDescriptor newNestedTypeDescriptor(Class<?> nestedType,
MethodParameter nested)
- Overrides:
newNestedTypeDescriptor in class TypeDescriptor