java.lang.Object | |
↳ | org.springframework.core.convert.TypeDescriptor |
Known Direct Subclasses |
Context about a type to convert to.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NULL | Constant defining a TypeDescriptor for a null value |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new type descriptor from a method or constructor parameter.
| |||||||||||
Create a new type descriptor for a field.
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a copy of this nested type descriptor and apply the specific type information from the indexed object.
| |||||||||||
A textual representation of the type descriptor (eg.
| |||||||||||
Create a new type descriptor for a nested type declared on an array, collection, or map-based method parameter.
| |||||||||||
Create a new type descriptor for a nested type declared on an array, collection, or map-based method parameter.
| |||||||||||
Create a new type descriptor for an object.
| |||||||||||
Obtain the annotation associated with the wrapped parameter/field, if any.
| |||||||||||
Obtain the annotations associated with the wrapped parameter/field, if any.
| |||||||||||
If this type is an array type or
Collection type, returns the underlying element type. | |||||||||||
Return the element type as a type descriptor.
| |||||||||||
Determine the generic key type of the wrapped Map parameter/field, if any.
| |||||||||||
Returns map key type as a type descriptor.
| |||||||||||
Determine the generic value type of the wrapped Map parameter/field, if any.
| |||||||||||
Returns map value type as a type descriptor.
| |||||||||||
Exposes the underlying MethodParameter providing context for this TypeDescriptor.
| |||||||||||
Returns the name of this type: the fully qualified class name.
| |||||||||||
Determine the declared type of the wrapped parameter/field.
| |||||||||||
Determine the declared (non-generic) type of the wrapped parameter/field.
| |||||||||||
Is this type an array type?
| |||||||||||
Returns true if an object of this type can be assigned to a reference of given targetType.
| |||||||||||
Is this type a
Collection type?
| |||||||||||
Is this type a
Map type?
| |||||||||||
Is this type a primitive type?
| |||||||||||
Create a new type descriptor for the given class.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constant defining a TypeDescriptor for a null
value
Create a new type descriptor from a method or constructor parameter. Use this constructor when a target conversion point originates from a method parameter, such as a setter method argument.
methodParameter | the MethodParameter to wrap |
---|
Create a new type descriptor for a field. Use this constructor when a target conversion point originates from a field.
field | the field to wrap |
---|
Create a copy of this nested type descriptor and apply the specific type information from the indexed object. Used to support collection and map indexing scenarios, where the indexer has a reference to the indexed type descriptor but needs to ensure its type actually represents the indexed object type. This is necessary to support type conversion during index object binding operations.
A textual representation of the type descriptor (eg. Map
Create a new type descriptor for a nested type declared on an array, collection, or map-based method parameter. 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.
nestedType | the nested type |
---|---|
methodParameter | the method parameter declaring the collection or map |
Create a new type descriptor for a nested type declared on an array, collection, or map-based method parameter. 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.
methodParameter | the method parameter declaring the collection or map |
---|
Create a new type descriptor for an object.
Use this factory method to introspect a source object's type before asking the conversion system to convert it to some another type.
Builds in population of nested type descriptors for collection and map objects through object introspection.
If the object is null, returns NULL
.
If the object is not a collection, simply calls valueOf(Class)
.
If the object is a collection, this factory method will derive the element type(s) by introspecting the collection.
object | the source object |
---|
Obtain the annotation associated with the wrapped parameter/field, if any.
Obtain the annotations associated with the wrapped parameter/field, if any.
If this type is an array type or Collection
type, returns the underlying element type.
Returns null
if the type is neither an array or collection.
Return the element type as a type descriptor.
Determine the generic key type of the wrapped Map parameter/field, if any.
null
if none
Returns map key type as a type descriptor.
Determine the generic value type of the wrapped Map parameter/field, if any.
null
if none
Returns map value type as a type descriptor.
Exposes the underlying MethodParameter providing context for this TypeDescriptor. Used to support legacy code scenarios where callers are already using the MethodParameter API (BeanWrapper). In general, favor use of the TypeDescriptor API over the MethodParameter API as it is independent of type context location. May be null if no MethodParameter was provided when this TypeDescriptor was constructed.
Returns the name of this type: the fully qualified class name.
Determine the declared type of the wrapped parameter/field. Returns the Object wrapper type if the underlying type is a primitive.
Determine the declared (non-generic) type of the wrapped parameter/field.
null
if this is NULL
Returns true if an object of this type can be assigned to a reference of given targetType.
targetType | the target type |
---|
Create a new type descriptor for the given class.
Use this to instruct the conversion system to convert to an object to a specific target type, when no type location such as a method parameter or field is available to provide additional conversion context.
Generally prefer use of forObject(Object)
for constructing source type descriptors for source objects.
type | the class |
---|