Class MapBasedValueSource

  • All Implemented Interfaces:
    FixedValueSource

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

      Fields 
      Modifier and Type Field Description
      private java.util.Map values  
    • Constructor Summary

      Constructors 
      Constructor Description
      MapBasedValueSource​(java.util.Map values)
      Construct a new value source to wrap the supplied map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getValue​(java.lang.String expression, InterpolationState interpolationState)
      Lookup the supplied expression as a key in the wrapped Map, and return its value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • values

        private final java.util.Map values
    • Constructor Detail

      • MapBasedValueSource

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

      • getValue

        public java.lang.Object getValue​(java.lang.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)