类 TypeMismatchException
- 所有已实现的接口:
Serializable
,ErrorCoded
public class TypeMismatchException extends PropertyAccessException
Exception thrown on a type mismatch when trying to set a bean property.- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
- 序列化表格
字段概要
字段 修饰符和类型 字段 说明 static String
ERROR_CODE
Error code that a type mismatch error will be registered with.
构造器概要
构造器 构造器 说明 TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType)
Create a newTypeMismatchException
.TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType, Throwable cause)
Create a newTypeMismatchException
.TypeMismatchException(Object value, Class<?> requiredType)
Create a newTypeMismatchException
without aPropertyChangeEvent
.TypeMismatchException(Object value, Class<?> requiredType, Throwable cause)
Create a newTypeMismatchException
without aPropertyChangeEvent
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getErrorCode()
Return a corresponding error code for this type of exception.Class<?>
getRequiredType()
Return the required target type, if any.Object
getValue()
Return the offending value (may benull
).从类继承的方法 org.springframework.beans.PropertyAccessException
getPropertyChangeEvent, getPropertyName
从类继承的方法 org.springframework.beans.BeansException
equals, hashCode
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
字段详细资料
ERROR_CODE
public static final String ERROR_CODE
Error code that a type mismatch error will be registered with.- 另请参阅:
- 常量字段值
构造器详细资料
TypeMismatchException
public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType)
Create a newTypeMismatchException
.- 参数:
propertyChangeEvent
- the PropertyChangeEvent that resulted in the problemrequiredType
- the required target type
TypeMismatchException
public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType, Throwable cause)
Create a newTypeMismatchException
.- 参数:
propertyChangeEvent
- the PropertyChangeEvent that resulted in the problemrequiredType
- the required target type (ornull
if not known)cause
- the root cause (may benull
)
TypeMismatchException
public TypeMismatchException(Object value, Class<?> requiredType)
Create a newTypeMismatchException
without aPropertyChangeEvent
.- 参数:
value
- the offending value that couldn't be converted (may benull
)requiredType
- the required target type (ornull
if not known)
TypeMismatchException
public TypeMismatchException(Object value, Class<?> requiredType, Throwable cause)
Create a newTypeMismatchException
without aPropertyChangeEvent
.- 参数:
value
- the offending value that couldn't be converted (may benull
)requiredType
- the required target type (ornull
if not known)cause
- the root cause (may benull
)
方法详细资料
getValue
public Object getValue()
Return the offending value (may benull
).- 覆盖:
getValue
在类中PropertyAccessException
getRequiredType
public Class<?> getRequiredType()
Return the required target type, if any.
getErrorCode
public String getErrorCode()
从类复制的说明:PropertyAccessException
Return a corresponding error code for this type of exception.- 指定者:
getErrorCode
在接口中ErrorCoded
- 指定者:
getErrorCode
在类中PropertyAccessException
- 返回:
- a String error code associated with this failure, or
null
if not error-coded