org.springframework.core.convert

Class ConversionFailedException

  • All Implemented Interfaces:
    java.io.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 Detail

      • ConversionFailedException

        public ConversionFailedException(@Nullable
                                         TypeDescriptor sourceType,
                                         TypeDescriptor targetType,
                                         @Nullable
                                         java.lang.Object value,
                                         java.lang.Throwable cause)
        Create a new conversion exception.
        Parameters:
        sourceType - the value's original type
        targetType - the value's target type
        value - the value we tried to convert
        cause - 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.
      • getValue

        @Nullable
        public java.lang.Object getValue()
        Return the offending value.