org.springframework.core.convert.support
Class PropertyTypeDescriptor

java.lang.Object
  extended by org.springframework.core.convert.TypeDescriptor
      extended by 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

Field Summary
 
Fields inherited from class org.springframework.core.convert.TypeDescriptor
NULL
 
Constructor Summary
PropertyTypeDescriptor(MethodParameter methodParameter, PropertyDescriptor propertyDescriptor)
          Create a new type descriptor for the given bean property.
 
Method Summary
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.
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.
 PropertyDescriptor getPropertyDescriptor()
          Return the underlying PropertyDescriptor.
protected  TypeDescriptor newNestedTypeDescriptor(Class<?> nestedType, MethodParameter nested)
           
protected  Annotation[] resolveAnnotations()
           
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyTypeDescriptor

public PropertyTypeDescriptor(MethodParameter methodParameter,
                              PropertyDescriptor propertyDescriptor)
Create a new type descriptor for the given bean property.

Parameters:
methodParameter - the target method parameter
propertyDescriptor - the corresponding JavaBean PropertyDescriptor
Method Detail

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 type
methodParameter - 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