public class TypeMismatchException extends PropertyAccessException
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERROR_CODE
Error code that a type mismatch error will be registered with.
|
Constructor and Description |
---|
TypeMismatchException(java.lang.Object value,
java.lang.Class<?> requiredType)
Create a new
TypeMismatchException without a PropertyChangeEvent . |
TypeMismatchException(java.lang.Object value,
java.lang.Class<?> requiredType,
java.lang.Throwable cause)
Create a new
TypeMismatchException without a PropertyChangeEvent . |
TypeMismatchException(java.beans.PropertyChangeEvent propertyChangeEvent,
java.lang.Class<?> requiredType)
Create a new
TypeMismatchException . |
TypeMismatchException(java.beans.PropertyChangeEvent propertyChangeEvent,
java.lang.Class<?> requiredType,
java.lang.Throwable cause)
Create a new
TypeMismatchException . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorCode()
Return a corresponding error code for this type of exception.
|
java.lang.String |
getPropertyName()
Return the name of the affected property, if available.
|
java.lang.Class<?> |
getRequiredType()
Return the required target type, if any.
|
java.lang.Object |
getValue()
Return the offending value (may be
null ). |
void |
initPropertyName(java.lang.String propertyName)
Initialize this exception's property name for exposure through
getPropertyName() ,
as an alternative to having it initialized via a PropertyChangeEvent . |
getPropertyChangeEvent
contains, getMessage, getMostSpecificCause, getRootCause
public static final java.lang.String ERROR_CODE
public TypeMismatchException(java.beans.PropertyChangeEvent propertyChangeEvent, java.lang.Class<?> requiredType)
TypeMismatchException
.propertyChangeEvent
- the PropertyChangeEvent that resulted in the problemrequiredType
- the required target typepublic TypeMismatchException(java.beans.PropertyChangeEvent propertyChangeEvent, @Nullable java.lang.Class<?> requiredType, @Nullable java.lang.Throwable cause)
TypeMismatchException
.propertyChangeEvent
- the PropertyChangeEvent that resulted in the problemrequiredType
- the required target type (or null
if not known)cause
- the root cause (may be null
)public TypeMismatchException(@Nullable java.lang.Object value, @Nullable java.lang.Class<?> requiredType)
TypeMismatchException
without a PropertyChangeEvent
.value
- the offending value that couldn't be converted (may be null
)requiredType
- the required target type (or null
if not known)initPropertyName(java.lang.String)
public TypeMismatchException(@Nullable java.lang.Object value, @Nullable java.lang.Class<?> requiredType, @Nullable java.lang.Throwable cause)
TypeMismatchException
without a PropertyChangeEvent
.value
- the offending value that couldn't be converted (may be null
)requiredType
- the required target type (or null
if not known)cause
- the root cause (may be null
)initPropertyName(java.lang.String)
public void initPropertyName(java.lang.String propertyName)
getPropertyName()
,
as an alternative to having it initialized via a PropertyChangeEvent
.propertyName
- the property name to exposeTypeMismatchException(Object, Class)
,
TypeMismatchException(Object, Class, Throwable)
@Nullable public java.lang.String getPropertyName()
getPropertyName
in class PropertyAccessException
@Nullable public java.lang.Object getValue()
null
).getValue
in class PropertyAccessException
@Nullable public java.lang.Class<?> getRequiredType()
public java.lang.String getErrorCode()
PropertyAccessException
getErrorCode
in class PropertyAccessException