List of usage examples for org.apache.commons.lang3.text StrBuilder replaceAll
public StrBuilder replaceAll(final StrMatcher matcher, final String replaceStr)
From source file:org.selenium.runner.services.SeleniumRunner.java
protected String injectValue(final String instruction) throws SeleniumRunnerException { if (instruction == null) { throw new SeleniumRunnerException("can't inject value in null instruction !"); }/*from w w w . j a va 2 s . co m*/ StrBuilder result = new StrBuilder(instruction); String keyPattern = null; for (String key : storedValues.keySet()) { keyPattern = "${" + key + "}"; if (result.contains(keyPattern)) { result.replaceAll(keyPattern, storedValues.get(key)); } } return result.toString(); }