Skip to content

Properties Substitution_97255449

nxi edited this page Apr 9, 2015 · 1 revision

Gumtree : Properties Substitution

Created by Tony Lam, last modified on Jul 06, 2009
ANT supports string substitution by using properties.  For example, if you have a property
myProperty = abc
Then you can use the property key in the XML script
<echo text=${myProperty} />

This will be resolve in runtime as text = abc.
GumTree provides similar functionality via org.gumtree.core.util.PropertiesHelper.  The constrain on this is it only fetch property value from the system properties (additional application properties are preloaded by org.gumtree.configurator during application startup).  To use this feature, simply refactor your corresponding model setter method from
public void setClassname(String classname) {
        this.classname = classname;
}
to
public void setClassname(String classname) {
        this.classname = PropertiesHelper.substitueWithProperties(classname);
}
Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally