org.springframework.data.mapping

## Class PropertyReferenceException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.springframework.data.mapping.PropertyReferenceException

All Implemented Interfaces:
  Serializable

    public class PropertyReferenceException
    extends RuntimeException

Exception being thrown when creating `PropertyPath` instances.

Author:
  Oliver Gierke, Christoph Strobl
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`PropertyReferenceException(String propertyName, TypeInformation<?> type, List<PropertyPath> alreadyResolvedPah)` Creates a new `PropertyReferenceException`.

### Method Summary

All Methods Instance Methods Concrete Methods
`PropertyPath` `getBaseProperty()` Returns the `PropertyPath` which could be resolved so far.
`String` `getMessage()`
`String` `getPropertyName()` Returns the name of the property not found.
`TypeInformation<?>` `getType()` Returns the type the property could not be found on.
`boolean` `hasDeeperResolutionDepthThan(PropertyReferenceException exception)` Returns whether the given `PropertyReferenceException` has a deeper resolution depth (i.e. a longer path of already resolved properties) than the current exception.

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

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, 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 Detail

#### PropertyReferenceException

    public PropertyReferenceException(String propertyName,
                                      TypeInformation<?> type,
                                      List<PropertyPath> alreadyResolvedPah)

Creates a new `PropertyReferenceException`.

Parameters:
  `propertyName` - the name of the property not found on the given type, must not be null or empty.
  `type` - the type the property could not be found on, must not be null.
  `alreadyResolvedPah` - the previously calculated `PropertyPath`s, must not be null.

### Method Detail

#### getPropertyName

    public String getPropertyName()

Returns the name of the property not found.

Returns:
  will not be null or empty.

#### getType

    public TypeInformation<?> getType()

Returns the type the property could not be found on.

Returns:
  will never be null.

#### getMessage

    public String getMessage()

Overrides:
  `getMessage` in class `Throwable`

#### getBaseProperty

    @Nullable
    public PropertyPath getBaseProperty()

Returns the `PropertyPath` which could be resolved so far.

Returns:

#### hasDeeperResolutionDepthThan

    public boolean hasDeeperResolutionDepthThan(PropertyReferenceException exception)

Returns whether the given `PropertyReferenceException` has a deeper resolution depth (i.e. a longer path of already resolved properties) than the current exception.

Parameters:
  `exception` - must not be null.
Returns: