站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

TypeMismatchException (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.beans
Class TypeMismatchException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.beans.BeansException
                      extended by org.springframework.beans.PropertyAccessException
                          extended by org.springframework.beans.TypeMismatchException
All Implemented Interfaces:
Serializable, ErrorCoded

public class TypeMismatchException
extends PropertyAccessException

Exception thrown on a type mismatch when trying to set a bean property.

Author:
Rod Johnson, Juergen Hoeller
See Also:
Serialized Form

Field Summary
static String ERROR_CODE
          Error code that a type mismatch error will be registered with.
 
Constructor Summary
TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requiredType)
          Create a new TypeMismatchException.
TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requiredType, Throwable ex)
          Create a new TypeMismatchException.
 
Method Summary
 String getErrorCode()
          Return the error code associated with this failure.
 Class getRequiredType()
          Return the required target type, if any.
 
Methods inherited from class org.springframework.beans.PropertyAccessException
getPropertyChangeEvent
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getCause, getMessage, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_CODE

public static final String ERROR_CODE
Error code that a type mismatch error will be registered with.

See Also:
Constant Field Values
Constructor Detail

TypeMismatchException

public TypeMismatchException(PropertyChangeEvent propertyChangeEvent,
                             Class requiredType)
Create a new TypeMismatchException.

Parameters:
propertyChangeEvent - the PropertyChangeEvent that resulted in the problem
requiredType - the required target type

TypeMismatchException

public TypeMismatchException(PropertyChangeEvent propertyChangeEvent,
                             Class requiredType,
                             Throwable ex)
Create a new TypeMismatchException.

Parameters:
propertyChangeEvent - the PropertyChangeEvent that resulted in the problem
requiredType - the required target type (or null if not known)
ex - the root cause (may be null)
Method Detail

getRequiredType

public Class getRequiredType()
Return the required target type, if any.


getErrorCode

public String getErrorCode()
Description copied from interface: ErrorCoded
Return the error code associated with this failure. The GUI can render this any way it pleases, allowing for localization etc.

Returns:
a String error code associated with this failure, or null if not error-coded


Copyright (c) 2002-2007 The Spring Framework Project.