Class MapBasedValueSource

  • All Implemented Interfaces:
    FixedValueSource

    public class MapBasedValueSource
    extends Object
    implements FixedValueSource
    Wraps a Map, and looks up the whole expression as a single key, returning the value mapped to it.
    • Constructor Detail

      • MapBasedValueSource

        public MapBasedValueSource​(Map values)
        Construct a new value source to wrap the supplied map.
        Parameters:
        values - the key/value pairs.
    • Method Detail

      • getValue

        public Object getValue​(String expression,
                               InterpolationState interpolationState)
        Lookup the supplied expression as a key in the wrapped Map, and return its value.
        Specified by:
        getValue in interface FixedValueSource
        Parameters:
        expression - The expression.
        interpolationState - InterpolationState.
        Returns:
        the value related to the expression, or null if not found (not available from this source)