|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.core.convert.TypeDescriptor
public class TypeDescriptor
Type metadata about a bindable target value.
| Field Summary | |
|---|---|
static TypeDescriptor |
NULL_TYPE_DESCRIPTOR
Constant value typeDescriptor for the type of a null value |
| Constructor Summary | |
|---|---|
TypeDescriptor(java.lang.Class<?> type)
Creates a new descriptor for the given type. |
|
TypeDescriptor(java.lang.reflect.Field field)
Create a new descriptor for a field. |
|
TypeDescriptor(MethodParameter methodParameter)
Create a new descriptor for a method or constructor parameter. |
|
| Method Summary | |
|---|---|
java.lang.String |
asString()
|
static TypeDescriptor |
forObject(java.lang.Object object)
Creates a new type descriptor for the class of the given object. |
java.lang.annotation.Annotation[] |
getAnnotations()
Obtain the annotations associated with the wrapped parameter/field, if any. |
java.lang.Class<?> |
getElementType()
If this type is an array type or Collection type, returns the underlying element type. |
java.lang.reflect.Field |
getField()
Return the wrapped Field, if any. |
java.lang.Class<?> |
getMapKeyType()
Determine the generic key type of the wrapped Map parameter/field, if any. |
java.lang.Class<?> |
getMapValueType()
Determine the generic value type of the wrapped Map parameter/field, if any. |
MethodParameter |
getMethodParameter()
Return the wrapped MethodParameter, if any. |
java.lang.String |
getName()
Returns the name of this type; the fully qualified classname. |
java.lang.Class<?> |
getType()
Determine the declared (non-generic) type of the wrapped parameter/field. |
boolean |
isAbstractClass()
Returns true if this type is an abstract class. |
boolean |
isArray()
Is this type an array type? |
boolean |
isAssignableTo(TypeDescriptor targetType)
Returns true if an object this type can be assigned to a rereference of given targetType. |
boolean |
isCollection()
Is this type a Collection type? |
boolean |
isInstance(java.lang.Object obj)
Is the obj an instance of this type? |
boolean |
isMap()
Is this type a Map type? |
boolean |
isMapEntryTypeKnown()
Is this descriptor for a map where the key type and value type are known? |
static TypeDescriptor |
valueOf(java.lang.Class<? extends java.lang.Object> type)
Creates a new type descriptor for the given class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final TypeDescriptor NULL_TYPE_DESCRIPTOR
| Constructor Detail |
|---|
public TypeDescriptor(java.lang.Class<?> type)
type - the actual typepublic TypeDescriptor(MethodParameter methodParameter)
methodParameter - the MethodParameter to wrappublic TypeDescriptor(java.lang.reflect.Field field)
field - the field to wrap| Method Detail |
|---|
public java.lang.Class<?> getType()
null)public java.lang.String getName()
public boolean isArray()
public boolean isCollection()
Collection type?
public java.lang.Class<?> getElementType()
Collection type, returns the underlying element type. Returns null if
the type is neither an array or collection.
public boolean isMap()
Map type?
public boolean isMapEntryTypeKnown()
public java.lang.Class<?> getMapKeyType()
null if nonepublic java.lang.Class<?> getMapValueType()
null if nonepublic java.lang.annotation.Annotation[] getAnnotations()
public MethodParameter getMethodParameter()
Note: Either MethodParameter or Field is available.
null if nonepublic java.lang.reflect.Field getField()
Note: Either MethodParameter or Field is available.
null if nonepublic boolean isAbstractClass()
public boolean isInstance(java.lang.Object obj)
public boolean isAssignableTo(TypeDescriptor targetType)
targetType - the target type
public static TypeDescriptor valueOf(java.lang.Class<? extends java.lang.Object> type)
type - the class
public static TypeDescriptor forObject(java.lang.Object object)
object - the object
public java.lang.String asString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||