# Uses of Class
org.springframework.core.convert.TypeDescriptor

Packages that use TypeDescriptor
Package
Description
org.springframework.core.convert
Type conversion system API.
org.springframework.core.convert.converter
SPI to implement Converters for the type conversion system.
org.springframework.core.convert.support
Default implementation of the type conversion system.

## Uses of TypeDescriptor in org.springframework.core.convert

Methods in org.springframework.core.convert that return TypeDescriptor
Modifier and Type
Method
Description
`static TypeDescriptor`
TypeDescriptor.`array(TypeDescriptor elementTypeDescriptor)`
Create a new type descriptor as an array of the specified type.
`static TypeDescriptor`
TypeDescriptor.`collection(Class<?> collectionType, TypeDescriptor elementTypeDescriptor)`
Create a new type descriptor from a `Collection` type.
`TypeDescriptor`
TypeDescriptor.`elementTypeDescriptor(Object element)`
If this type is a `Collection` or an array, creates an element TypeDescriptor from the provided collection or array element.
`static TypeDescriptor`
TypeDescriptor.`forObject(Object source)`
Create a new type descriptor for an object.
`TypeDescriptor`
TypeDescriptor.`getElementTypeDescriptor()`
If this type is an array, returns the array's component type.
`TypeDescriptor`
TypeDescriptor.`getMapKeyTypeDescriptor()`
If this type is a `Map` and its key type is parameterized, returns the map's key type.
`TypeDescriptor`
TypeDescriptor.`getMapKeyTypeDescriptor(Object mapKey)`
If this type is a `Map`, creates a mapKey `TypeDescriptor` from the provided map key.
`TypeDescriptor`
TypeDescriptor.`getMapValueTypeDescriptor()`
If this type is a `Map` and its value type is parameterized, returns the map's value type.
`TypeDescriptor`
TypeDescriptor.`getMapValueTypeDescriptor(Object mapValue)`
If this type is a `Map`, creates a mapValue `TypeDescriptor` from the provided map value.
`TypeDescriptor`
ConversionFailedException.`getSourceType()`
Return the source type we tried to convert the value from.
`TypeDescriptor`
ConverterNotFoundException.`getSourceType()`
Return the source type that was requested to convert from.
`TypeDescriptor`
ConversionFailedException.`getTargetType()`
Return the target type we tried to convert the value to.
`TypeDescriptor`
ConverterNotFoundException.`getTargetType()`
Return the target type that was requested to convert to.
`static TypeDescriptor`
TypeDescriptor.`map(Class<?> mapType, TypeDescriptor keyTypeDescriptor, TypeDescriptor valueTypeDescriptor)`
Create a new type descriptor from a `Map` type.
`TypeDescriptor`
TypeDescriptor.`narrow(Object value)`
Narrows this `TypeDescriptor` by setting its type to the class of the provided value.
`TypeDescriptor`
TypeDescriptor.`nested(int nestingLevel)`
Create a type descriptor for a nested type declared within this descriptor.
`static TypeDescriptor`
TypeDescriptor.`nested(Field field, int nestingLevel)`
Create a type descriptor for a nested type declared within the field.
`static TypeDescriptor`
TypeDescriptor.`nested(Property property, int nestingLevel)`
Create a type descriptor for a nested type declared within the property.
`static TypeDescriptor`
TypeDescriptor.`nested(MethodParameter methodParameter, int nestingLevel)`
Create a type descriptor for a nested type declared within the method parameter.
`TypeDescriptor`
TypeDescriptor.`upcast(Class<?> superType)`
Cast this `TypeDescriptor` to a superclass or implemented interface preserving annotations and nested type context.
`static TypeDescriptor`
TypeDescriptor.`valueOf(Class<?> type)`
Create a new type descriptor from the given type.
Methods in org.springframework.core.convert with parameters of type TypeDescriptor
Modifier and Type
Method
Description
`static TypeDescriptor`
TypeDescriptor.`array(TypeDescriptor elementTypeDescriptor)`
Create a new type descriptor as an array of the specified type.
`boolean`
ConversionService.`canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)`
Return `true` if objects of `sourceType` can be converted to the `targetType`.
`static TypeDescriptor`
TypeDescriptor.`collection(Class<?> collectionType, TypeDescriptor elementTypeDescriptor)`
Create a new type descriptor from a `Collection` type.
`default Object`
ConversionService.`convert(Object source, TypeDescriptor targetType)`
Convert the given `source` to the specified `targetType`.
`Object`
ConversionService.`convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)`
Convert the given `source` to the specified `targetType`.
`boolean`
TypeDescriptor.`isAssignableTo(TypeDescriptor typeDescriptor)`
Returns true if an object of this type descriptor can be assigned to the location described by the given type descriptor.
`static TypeDescriptor`
TypeDescriptor.`map(Class<?> mapType, TypeDescriptor keyTypeDescriptor, TypeDescriptor valueTypeDescriptor)`
Create a new type descriptor from a `Map` type.
Constructors in org.springframework.core.convert with parameters of type TypeDescriptor
Modifier
Constructor
Description
``
`ConversionFailedException(TypeDescriptor sourceType, TypeDescriptor targetType, Object value, Throwable cause)`
Create a new conversion exception.
``
`ConverterNotFoundException(TypeDescriptor sourceType, TypeDescriptor targetType)`
Create a new conversion executor not found exception.

## Uses of TypeDescriptor in org.springframework.core.convert.converter

Methods in org.springframework.core.convert.converter with parameters of type TypeDescriptor
Modifier and Type
Method
Description
`Object`
GenericConverter.`convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)`
Convert the source object to the targetType described by the `TypeDescriptor`.
`boolean`
ConditionalConverter.`matches(TypeDescriptor sourceType, TypeDescriptor targetType)`
Should the conversion from `sourceType` to `targetType` currently under consideration be selected?

## Uses of TypeDescriptor in org.springframework.core.convert.support

Methods in org.springframework.core.convert.support with parameters of type TypeDescriptor
Modifier and Type
Method
Description
`boolean`
GenericConversionService.`canBypassConvert(TypeDescriptor sourceType, TypeDescriptor targetType)`
Return whether conversion between the source type and the target type can be bypassed.
`boolean`
GenericConversionService.`canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)`
`Object`
GenericConversionService.`convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)`
`protected Object`
GenericConversionService.`convertNullSource(TypeDescriptor sourceType, TypeDescriptor targetType)`
Template method to convert a `null` source.
`protected GenericConverter`
GenericConversionService.`getConverter(TypeDescriptor sourceType, TypeDescriptor targetType)`
Hook method to look up the converter for a given sourceType/targetType pair.
`protected GenericConverter`
GenericConversionService.`getDefaultConverter(TypeDescriptor sourceType, TypeDescriptor targetType)`
Return the default converter if no converter is found for the given sourceType/targetType pair.
Constructors in org.springframework.core.convert.support with parameters of type TypeDescriptor
Modifier
Constructor
Description
``
`ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor)`
Create a new ConvertingPropertyEditorAdapter for a given `ConversionService` and the given target type.