Class PropertyExpression


  • public class PropertyExpression
    extends Object
    Utility class responsible for searching for expressions of the form ${property} within strings and replacing them with the value of the corresponding property from the given Properties - if there is one.
    Author:
    Christof Reichardt
    • Constructor Detail

      • PropertyExpression

        public PropertyExpression​(Properties properties)
        Constructor expects some Properties.
        Parameters:
        properties - the given name-value pairs
    • Method Detail

      • replace

        public String replace​(String expression,
                              boolean recursive)
        Replaces expressions of the form ${property} within the given String by replacing ${property} with the corresponding property value.
        Parameters:
        expression - the to be examined String
        recursive - if true the replacement is recursively executed until no expressions of the form ${property} can be found anymore
        Returns:
        the substituted String
      • replace

        public String replace​(String expression)
        Replaces expressions of the form ${property} within the given String by replacing ${property} with the corresponding property value (no recursion) .
        Parameters:
        expression - the to be examined String
        Returns:
        the substituted String