Package de.christofreichardt.util
Class PropertyExpression
- java.lang.Object
-
- de.christofreichardt.util.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 Summary
Constructors Constructor Description PropertyExpression(Properties properties)Constructor expects some Properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringreplace(String expression)Replaces expressions of the form ${property} within the given String by replacing ${property} with the corresponding property value (no recursion) .Stringreplace(String expression, boolean recursive)Replaces expressions of the form ${property} within the given String by replacing ${property} with the corresponding property value.
-
-
-
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 Stringrecursive- if true the replacement is recursively executed until no expressions of the form ${property} can be found anymore- Returns:
- the substituted String
-
-