| java.lang.Object org.apache.roller.util.PropertyExpander
PropertyExpander | public class PropertyExpander (Code) | | Property expansion utility. This utility provides static methods to expand properties appearing in strings.
author: Anil Gangolli (Portions based on code from David Graff submitted for author: ROL-613) since: Roller 1.3 |
expandProperties | public static String expandProperties(String input, Map props)(Code) | | Expand property expressions in the input. Expands property expressions of the form ${propertyname}
in the input, replacing each such expression with the value associated to the respective key
propertyname in the supplied map. If for a given expression, the property is undefined (has null
value) in the map supplied, that expression is left unexpanded in the resulting string.
Note that expansion is not recursive. If the value of one property contains another expression, the expression
appearing in the value will not be expanded further.
Parameters: input - the input string. This may be null, in which case null is returned. Parameters: props - the map of property values to use for expansion. This map should have String keys andString values. Any object of class java.util.Properties works here, as willother implementations of such maps. the result of replacing property expressions with the values of the corresponding properties from thesupplied property map, null if the input string is null. |
expandSystemProperties | public static String expandSystemProperties(String input)(Code) | | Expand system properties in the input string. This is equivalent to calling expandProperties(input,
System.getProperties()) .
Parameters: input - the result of replacing property expressions with the values of the corresponding system properties. See Also: System.getProperties |
|
|