![JAR search and dependency download from the Maven repository](/logo.png)
nl.hsac.fitnesse.symbols.DefineDefaultFromProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-plugin Show documentation
Show all versions of hsac-fitnesse-plugin Show documentation
Plugin to add features to a FitNesse installation
The newest version!
package nl.hsac.fitnesse.symbols;
import fitnesse.wikitext.parser.Parser;
import java.util.Properties;
/**
* DefineFromProperties which only takes those properties from .properties that define variables not aready set via
* a system property.
*/
public class DefineDefaultFromProperties extends DefineFromProperties {
public DefineDefaultFromProperties() {
super("DefineDefaultFromProperties", "!defineDefaultFromProperties");
}
@Override
protected String handleProperty(Parser parser, Properties props, String propertyName) {
String variableValue;
String propValue = System.getProperty(propertyName);
if (propValue == null) {
variableValue = super.handleProperty(parser, props, propertyName);
} else {
variableValue = propValue;
}
return variableValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy