Class MapBasedValueSource

  • All Implemented Interfaces:
    ValueSource

    public class MapBasedValueSource
    extends AbstractValueSource
    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.
    • 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 - key,value of mapping.
    • Method Detail

      • getValue

        public java.lang.Object getValue​(java.lang.String expression)
        Lookup the supplied expression as a key in the wrapped Map, and return its value.
        Parameters:
        expression - The string expression.
        Returns:
        the value related to the expression, or null if not found.