Top Description Fields Constructors Methods
org.springframework.core.convert

public Class ConversionFailedException

extends ConversionException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.lang.Nullable, org.springframework.util.ObjectUtils

Exception to be thrown when an actual type conversion attempt fails.
Authors
Keith Donald, Juergen Hoeller
Since
3.0

Field Summary

Modifier and TypeField and Description
private final TypeDescriptor
private final TypeDescriptor
private final Object

Constructor Summary

AccessConstructor and Description
public
ConversionFailedException(TypeDescriptor
the value's original type
sourceType
,
TypeDescriptor
the value's target type
targetType
,
Object
the value we tried to convert
value
,
Throwable
the cause of the conversion failure
cause
)

Create a new conversion exception.

Method Summary

Modifier and TypeMethod and Description
public TypeDescriptor
getSourceType()

Return the source type we tried to convert the value from.

public TypeDescriptor
getTargetType()

Return the target type we tried to convert the value to.

public Object
getValue()

Return the offending value.

Field Detail

sourceTypeback to summary
private final TypeDescriptor sourceType
Annotations
@Nullable
targetTypeback to summary
private final TypeDescriptor targetType
valueback to summary
private final Object value
Annotations
@Nullable

Constructor Detail

ConversionFailedExceptionback to summary
public ConversionFailedException(TypeDescriptor sourceType, TypeDescriptor targetType, Object value, Throwable cause)

Create a new conversion exception.

Parameters
sourceType:TypeDescriptor

the value's original type

targetType:TypeDescriptor

the value's target type

value:Object

the value we tried to convert

cause:Throwable

the cause of the conversion failure

Method Detail

getSourceTypeback to summary
public TypeDescriptor getSourceType()

Return the source type we tried to convert the value from.

Annotations
@Nullable
getTargetTypeback to summary
public TypeDescriptor getTargetType()

Return the target type we tried to convert the value to.

getValueback to summary
public Object getValue()

Return the offending value.

Annotations
@Nullable