com.agimatec.commons.util
Class PropertyReplacer
java.lang.Object
com.agimatec.commons.util.PropertyReplacer
public class PropertyReplacer
- extends Object
Description: Class to replace ${property} properties by a value in a Map.
Idea and code based on Jakarta ANT's ProjectHelper.java.
- Author:
- Roman Stumm
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertyReplacer
public PropertyReplacer(Map aProperties)
getProperties
public Map getProperties()
replaceProperties
public String replaceProperties(String value,
String chars)
- Replace in a simple style with flexible separator chars, e.g. [name] or {name} or (name}.
(Note: the double beginChar is replace by a single beginChar)
- Parameters:
value - - string to replace properties inchars - - a two-char string with begin+end char, default (if null) = "{}"
replaceProperties
public String replaceProperties(String value)
- Source based on ant's tools.ant.ProjectHelper.java
Replace ${} style constructions in the given value with the string value of
the corresponding data types.
- Parameters:
value - the string to be scanned for property references.
- Returns:
- the string with properties replaced by their value
Copyright © 2008-2014. All Rights Reserved.