Class InvalidPropertyPathException
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.InvalidPropertyPathException
- All Implemented Interfaces:
Serializable
Exception thrown when a property path is not well-formed according to the grammar
implemented by
PropertyPath.
This signals a syntactically invalid path, as opposed to a syntactically valid
path that happens not to resolve against a particular target object. The latter
cases are reported as NotReadablePropertyException or
NotWritablePropertyException instead.
Extends PropertyAccessException so that a malformed path
encountered while binding a single property value can be collected into a
PropertyBatchUpdateException alongside other per-property failures,
rather than aborting the whole binding operation.
- Since:
- 7.1
- Author:
- Brian Clozel
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError code that anInvalidPropertyPathExceptionis registered with. -
Constructor Summary
ConstructorsConstructorDescriptionInvalidPropertyPathException(PropertyChangeEvent propertyChangeEvent, InvalidPropertyPathException cause) Create a newInvalidPropertyPathException.InvalidPropertyPathException(Object source, String propertyName, @Nullable Object newValue, InvalidPropertyPathException cause) Create a newInvalidPropertyPathException.InvalidPropertyPathException(String propertyPath, String reason) Create a newInvalidPropertyPathException. -
Method Summary
Modifier and TypeMethodDescriptionReturn a corresponding error code for this type of exception.Return the offending property path.Methods inherited from class PropertyAccessException
getPropertyChangeEvent, getPropertyName, getValueMethods inherited from class NestedRuntimeException
contains, getMostSpecificCause, getRootCauseMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ERROR_CODE
Error code that anInvalidPropertyPathExceptionis registered with.- See Also:
-
-
Constructor Details
-
InvalidPropertyPathException
-
InvalidPropertyPathException
public InvalidPropertyPathException(PropertyChangeEvent propertyChangeEvent, InvalidPropertyPathException cause) Create a newInvalidPropertyPathException.- Parameters:
propertyChangeEvent- the event for the propertycause- the original parsing exception
-
InvalidPropertyPathException
public InvalidPropertyPathException(Object source, String propertyName, @Nullable Object newValue, InvalidPropertyPathException cause) Create a newInvalidPropertyPathException.- Parameters:
source- the bean that fired the eventpropertyName- the programmatic name of the property that was changednewValue- the new value of the propertycause- the original parsing exception
-
-
Method Details
-
getPropertyPath
Return the offending property path. -
getErrorCode
Description copied from class:PropertyAccessExceptionReturn a corresponding error code for this type of exception.- Specified by:
getErrorCodein classPropertyAccessException
-