Class PropertiesBasedValueSource

  • All Implemented Interfaces:
    FixedValueSource

    public class PropertiesBasedValueSource
    extends java.lang.Object
    implements FixedValueSource
    FixedValueSource implementation that wraps a Properties instance, and does a simple lookup of the entire expression string as the parameter for Properties.getProperty(String), returning the result as the resolved value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Properties properties  
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertiesBasedValueSource​(java.util.Properties properties)
      Wrap the specified Properties object for use as a value source.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getValue​(java.lang.String expression, InterpolationState interpolationState)  
      • Methods inherited from class java.lang.Object

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

      • properties

        private final java.util.Properties properties
    • Constructor Detail

      • PropertiesBasedValueSource

        public PropertiesBasedValueSource​(java.util.Properties properties)
        Wrap the specified Properties object for use as a value source. Nulls are allowed.
        Parameters:
        properties - The properties instance to wrap.
    • Method Detail

      • getValue

        public java.lang.Object getValue​(java.lang.String expression,
                                         InterpolationState interpolationState)
        Specified by:
        getValue in interface FixedValueSource
        Parameters:
        expression - The expression.
        interpolationState - InterpolationState.
        Returns:
        the result of Properties.getProperty(String), using the entire expression as the key to lookup. If the wrapped properties instance is null, simply return null.