EnvironmentMethodResolver class final

A MethodResolver that lets expressions call the methods of an Environment (or any PropertyResolver) under their Java names.

It covers getProperty(key) and getProperty(key, default), getRequiredProperty, containsProperty, resolvePlaceholders, resolveRequiredPlaceholders, and on an Environment also getActiveProfiles(), getDefaultProfiles() and matchesProfiles(...). Spring calls these by reflection; here StandardBeanExpressionResolver registers this resolver for @Value expressions.

// In @Value:
// "#{environment.getProperty('app.timeout', '30')}"
// "#{environment.matchesProfiles('dev')}"

Spring (Java):

@Value("#{environment.getProperty('app.timeout', '30')}")
Implemented types

Constructors

EnvironmentMethodResolver()
Creates the resolver (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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(EvaluationContext context, Object target, String name, List<Object?> arguments) → MethodExecutor?
An executor that runs method name on target with arguments (already evaluated), or null to let the next resolver try.
override
toString() → String
A string representation of this object.
inherited

Operators

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