Class ExpressionEvalMap

java.lang.Object
java.util.AbstractMap<String,​Object>
org.springframework.integration.expression.ExpressionEvalMap
All Implemented Interfaces:
Map<String,​Object>

public final class ExpressionEvalMap
extends AbstractMap<String,​Object>

An immutable AbstractMap implementation that wraps a Map<String, Object>, where values must be instances of String or Expression, and evaluates an expression for the provided key from the underlying original Map.

Any mutating operations (put(String, Object), remove(Object) etc.) are not allowed on instances of this class. Mutation can be performed on underlying Map if it supports it.

A ExpressionEvalMap.ExpressionEvalMapBuilder must be used to instantiate this class via its from(Map) method:

 
ExpressionEvalMap evalMap = ExpressionEvalMap
    .from(expressions)
    .usingCallback(new EvaluationCallback() {
        Object evaluate(Expression expression) {
	            // return some expression evaluation
        }
    })
    .build();

 

Thread-safety depends on the original underlying Map. Objects of this class are not serializable.

Since:
3.0
Author:
Artem Bilan, Gary Russell