AccessException class

The exception a plug-in (property or index accessor, method, constructor or bean resolver, executor) throws to say it could not do its job.

Throw it from your own plug-ins to have the failure reported as a SpelEvaluationException with the matching code (exceptionDuringMethodInvocation, exceptionDuringBeanResolution, ...) and the expression's position; other exceptions from method and constructor executors propagate unchanged.

// A method that cannot run while its service is closed.
MethodExecutor executor = (context, target, args) =>
    throw AccessException('Service is closed');

Spring (Java):

throw new AccessException("Service is closed");
Implemented types

Constructors

AccessException(String message, [Object? cause])
Creates an exception with message, optionally wrapping cause.

Properties

cause → Object?
The error that caused this one, or null.
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
What went wrong; it becomes part of the SpEL error message.
final
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.
override

Operators

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