public class TypeMismatchException extends PropertyAccessException
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ERROR_CODE
Error code that a type mismatch error will be registered with.
|
| 构造器和说明 |
|---|
TypeMismatchException(Object value,
Class<?> requiredType)
Create a new
TypeMismatchException without a PropertyChangeEvent. |
TypeMismatchException(Object value,
Class<?> requiredType,
Throwable cause)
Create a new
TypeMismatchException without a PropertyChangeEvent. |
TypeMismatchException(PropertyChangeEvent propertyChangeEvent,
Class<?> requiredType)
Create a new
TypeMismatchException. |
TypeMismatchException(PropertyChangeEvent propertyChangeEvent,
Class<?> requiredType,
Throwable cause)
Create a new
TypeMismatchException. |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getErrorCode()
Return a corresponding error code for this type of exception.
|
String |
getPropertyName()
Return the name of the affected property, if available.
|
Class<?> |
getRequiredType()
Return the required target type, if any.
|
Object |
getValue()
Return the offending value (may be
null). |
void |
initPropertyName(String propertyName)
Initialize this exception's property name for exposure through
getPropertyName(),
as an alternative to having it initialized via a PropertyChangeEvent. |
getPropertyChangeEventcontains, getMessage, getMostSpecificCause, getRootCausepublic TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType)
TypeMismatchException.propertyChangeEvent - the PropertyChangeEvent that resulted in the problemrequiredType - the required target typepublic TypeMismatchException(PropertyChangeEvent propertyChangeEvent, @Nullable Class<?> requiredType, @Nullable 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
Object value,
@Nullable
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
Object value,
@Nullable
Class<?> requiredType,
@Nullable
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(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 String getPropertyName()
@Nullable public Object getValue()
null).getValue 在类中 PropertyAccessException@Nullable public Class<?> getRequiredType()
public String getErrorCode()
PropertyAccessExceptiongetErrorCode 在类中 PropertyAccessException