Package org.springframework.beans

# Class PropertyAccessException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.PropertyAccessException

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `MethodInvocationException`, `TypeMismatchException`

public abstract class PropertyAccessException extends BeansException
Superclass for exceptions related to a property access, such as type mismatch or invocation target exception.

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

## Constructor Summary

Constructors
Constructor
Description
`PropertyAccessException(PropertyChangeEvent propertyChangeEvent, String msg, Throwable cause)`
Create a new PropertyAccessException.
`PropertyAccessException(String msg, Throwable cause)`
Create a new PropertyAccessException without PropertyChangeEvent.

## Method Summary

Modifier and Type
Method
Description
`abstract String`
`getErrorCode()`
Return a corresponding error code for this type of exception.
`PropertyChangeEvent`
`getPropertyChangeEvent()`
Return the PropertyChangeEvent that resulted in the problem.
`String`
`getPropertyName()`
Return the name of the affected property, if available.
`Object`
`getValue()`
Return the affected value that was about to be set, if any.

### Methods inherited from class org.springframework.core.NestedRuntimeException

`contains, getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### PropertyAccessException

public PropertyAccessException(PropertyChangeEvent propertyChangeEvent, String msg, @Nullable Throwable cause)
Create a new PropertyAccessException.

Parameters:
  `propertyChangeEvent` - the PropertyChangeEvent that resulted in the problem
  `msg` - the detail message
  `cause` - the root cause

### PropertyAccessException

public PropertyAccessException(String msg, @Nullable Throwable cause)
Create a new PropertyAccessException without PropertyChangeEvent.

Parameters:
  `msg` - the detail message
  `cause` - the root cause

## Method Details

### getPropertyChangeEvent

@Nullable public PropertyChangeEvent getPropertyChangeEvent()
Return the PropertyChangeEvent that resulted in the problem.

May be `null`; only available if an actual bean property was affected.

### getPropertyName

@Nullable public String getPropertyName()
Return the name of the affected property, if available.

### getValue

@Nullable public Object getValue()
Return the affected value that was about to be set, if any.

### getErrorCode

public abstract String getErrorCode()
Return a corresponding error code for this type of exception.