org.apache.tamaya.resolver.spi

## Interface ExpressionEvaluator

- All Known Implementing Classes:
    DefaultExpressionEvaluator

      public interface ExpressionEvaluator

  Interface that provides an SPI that can be accessed from the current `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.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `evaluateExpression(String key, String value)` Evaluates the current expression.

- - ### Method Detail

    - #### evaluateExpression

          String evaluateExpression(String key,
                                  String value)

      Evaluates the current expression.
      Parameters:
        `key` - the key, not null.
        `value` - the value to be filtered/evaluated.
      Returns:
        the filtered/evaluated value, including null.

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.