public interface ExpressionEvaluator
ServiceContext
,
which allows to pass expression that contain placeholders and variable expressions. Expressions passed hereby
use UNIX styled variable syntax as follows:
${expression} My name is ${expression}. Also multiple expressions are support, e.g. ${expression1}, ${expression2}.By default all registered instances of
ExpressionResolver
are called to
evaluate an expression, depending on the annotatated Priority
on the resolver classes.
Nevertheless with ExpressionResolver.getResolverPrefix()
each resolver instance defines a unique id, by
which a resolver can be explicitly addressed as follows:
${env:MACHINE_NAME} My name is ${sys:instance.name}. Also multiple expressions are supported, e.g. ${resource:META-INF/version.conf}, ${file:C:/temp/version.txt}, ${url:http://configserver/name}.Basically this service is consumed by an instance of
PropertyFilter
, which
takes the configuration values found and passes them to this evaluator, when expressions are detected. This
also done iteratively, so also multi-stepped references (references, which themselves must be evaluated as well)
are supported.Modifier and Type | Method and Description |
---|---|
String |
evaluateExpression(String key,
String value)
Evaluates the current expression.
|
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.