Package com.oorian.data.converter
Class ConversionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.oorian.data.converter.ConversionException
- All Implemented Interfaces:
Serializable
Thrown when a type conversion fails.
The Throwable.getMessage() method returns a user-friendly message suitable for
displaying in the UI (e.g., "Please enter a valid number"). The original invalid
value is available via getInvalidValue().
- Since:
- 2.1
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConversionException(String message) Creates a new ConversionException with a user-friendly message.ConversionException(String message, Object invalidValue) Creates a new ConversionException with a message and the invalid value.ConversionException(String message, Object invalidValue, Throwable cause) Creates a new ConversionException with a message, invalid value, and cause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value that could not be converted.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ConversionException
Creates a new ConversionException with a user-friendly message.- Parameters:
message- a user-friendly error message
-
ConversionException
Creates a new ConversionException with a message and the invalid value.- Parameters:
message- a user-friendly error messageinvalidValue- the value that could not be converted
-
ConversionException
Creates a new ConversionException with a message, invalid value, and cause.- Parameters:
message- a user-friendly error messageinvalidValue- the value that could not be convertedcause- the underlying cause
-
-
Method Details
-
getInvalidValue
Returns the value that could not be converted.- Returns:
- the invalid value, or
nullif not available
-