Package org.springframework.core.convert
Class ConversionFailedException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.core.convert.ConversionException
- org.springframework.core.convert.ConversionFailedException
- All Implemented Interfaces:
Serializable
public class ConversionFailedException extends ConversionException
Exception to be thrown when an actual type conversion attempt fails.- Since:
- 3.0
- Author:
- Keith Donald, Juergen Hoeller
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description ConversionFailedException(TypeDescriptor sourceType, TypeDescriptor targetType, Object value, Throwable cause)
Create a new conversion exception.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDescriptor
getSourceType()
Return the source type we tried to convert the value from.TypeDescriptor
getTargetType()
Return the target type we tried to convert the value to.Object
getValue()
Return the offending value.Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
ConversionFailedException
public ConversionFailedException(@Nullable TypeDescriptor sourceType, TypeDescriptor targetType, @Nullable Object value, Throwable cause)
Create a new conversion exception.- Parameters:
sourceType
- the value's original typetargetType
- the value's target typevalue
- the value we tried to convertcause
- the cause of the conversion failure
Method Detail
getSourceType
@Nullable public TypeDescriptor getSourceType()
Return the source type we tried to convert the value from.
getTargetType
public TypeDescriptor getTargetType()
Return the target type we tried to convert the value to.