NullValueInNestedPathException class

The error a BeanWrapper throws when a path goes through a null value, such as address in address.city.

Enable BeanWrapper.autoGrowNestedPaths to create the missing objects instead; setPropertyValues skips these with ignoreInvalid.

// A new Person has no address yet.
try {
  BeanWrapper(Person()).setPropertyValue('address.city', 'Lyon');
} on NullValueInNestedPathException catch (e) {
  log.warning(e.propertyName); // address
}

Spring (Java):

try {
  new BeanWrapperImpl(new Person()).setPropertyValue("address.city", "x");
} catch (NullValueInNestedPathException e) {
  log.warn(e.getPropertyName());
}
Inheritance

Constructors

NullValueInNestedPathException(Type beanType, String propertyName)
The path propertyName of beanType evaluated to null.

Properties

beanType → Type
The type of the wrapped (root) object.
final
cause → Object?
The error that caused this one, if any: what a constructor threw, or the container error of a nested bean.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
message → String
A human-readable description of the problem.
finalinherited
mostSpecificCause → Object
rootCause, or this exception when it has no cause. Spring: getMostSpecificCause().
no setterinherited
propertyName → String
The part of the path whose value is null.
final
rootCause → Object?
The innermost cause: cause followed through nested container errors, or null without a cause. Usually the error that really went wrong. Spring: getRootCause().
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited