Package org.springframework.beans
Class MethodInvocationException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.beans.BeansException
- org.springframework.beans.PropertyAccessException
- org.springframework.beans.MethodInvocationException
- All Implemented Interfaces:
Serializable,ErrorCoded
public class MethodInvocationException extends PropertyAccessException
Thrown when a bean property getter or setter method throws an exception, analogous to an InvocationTargetException.- Author:
- Rod Johnson
- See Also:
- Serialized Form
Field Summary
Fields Modifier and Type Field Description static StringERROR_CODEError code that a method invocation error will be registered with.
Constructor Summary
Constructors Constructor Description MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwable cause)Create a new MethodInvocationException.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetErrorCode()Return a corresponding error code for this type of exception.Methods inherited from class org.springframework.beans.PropertyAccessException
getPropertyChangeEvent, getPropertyName, getValue
Methods inherited from class org.springframework.beans.BeansException
equals, hashCode
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Field Detail
ERROR_CODE
public static final String ERROR_CODE
Error code that a method invocation error will be registered with.- See Also:
- Constant Field Values
Constructor Detail
MethodInvocationException
public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwable cause)
Create a new MethodInvocationException.- Parameters:
propertyChangeEvent- PropertyChangeEvent that resulted in an exceptioncause- the Throwable raised by the invoked method
Method Detail
getErrorCode
public String getErrorCode()
Description copied from class:PropertyAccessExceptionReturn a corresponding error code for this type of exception.- Specified by:
getErrorCodein interfaceErrorCoded- Specified by:
getErrorCodein classPropertyAccessException- Returns:
- a String error code associated with this failure, or
nullif not error-coded