BeanExpressionContextAccessor class final
A PropertyAccessor that reads the beans of a BeanExpressionContext
as its properties, so that #{mailer} is the bean mailer.
StandardBeanExpressionResolver registers it for every @Value
expression; you need it only to evaluate expressions against a
BeanExpressionContext in a context of your own. Beans cannot be
assigned through it.
// `mailer` reads the bean of that name.
final context = StandardEvaluationContext(BeanExpressionContext(factory))
..addPropertyAccessor(const BeanExpressionContextAccessor());
SpelExpressionParser().parseExpression('mailer').getValue(context);
Spring (Java):
context.addPropertyAccessor(new BeanExpressionContextAccessor());
parser.parseExpression("mailer").getValue(context);
- Implemented types
Constructors
- BeanExpressionContextAccessor()
-
Creates the accessor (stateless).
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
canRead(
EvaluationContext context, Object target, String name) → bool -
Whether this accessor handles reading property
nameoftarget;falselets the next accessor try.targetis nevernull.override -
canWrite(
EvaluationContext context, Object target, String name) → bool -
Whether this accessor handles writing property
nameoftarget; returnfalsefor read-only properties.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
EvaluationContext context, Object target, String name) → Object? -
The value of property
nameoftarget; only called after canRead returnedtrue.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
EvaluationContext context, Object target, String name, Object? newValue) → void -
Stores
newValuein propertynameoftarget; only called after canWrite returnedtrue.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited