@Test public void testReplaceVariable() { String name = "path"; String value = "${path};/usr/local/bin"; JAXBConfigImpl config = new JAXBConfigImpl(); config.replaceVariable(name, value); }
protected String replaceVariable(String name, String value) { String regex = "(?:\\$\\{" + name + "\\})"; String temporary = null; if (value.contains("${" + name + "}")) { if ((temporary = rawProperties.getProperty(name)) == null) { temporary = System.getProperty(name); } if (temporary != null) { return value.replaceAll(regex, Matcher.quoteReplacement(temporary)); } } return value; }
JAXBConfigImpl extends AbstractBaseConfig { protected String replaceVariable(String name, String value) { String regex = "(?:\\$\\{" + name + "\\})"; String temporary = null; if (value.contains("${" + name + "}")) { if ((temporary = rawProperties.getProperty(name)) == null) { temporary = System.getProperty(name); } if (temporary != null) { return value.replaceAll(regex, Matcher.quoteReplacement(temporary)); } } return value; } }
JAXBConfigImpl extends AbstractBaseConfig { protected String replaceVariable(String name, String value) { String regex = "(?:\\$\\{" + name + "\\})"; String temporary = null; if (value.contains("${" + name + "}")) { if ((temporary = rawProperties.getProperty(name)) == null) { temporary = System.getProperty(name); } if (temporary != null) { return value.replaceAll(regex, Matcher.quoteReplacement(temporary)); } } return value; } JAXBConfigImpl();  JAXBConfigImpl(Config config);  JAXBConfigImpl(String fileLoc, Config config);  JAXBConfigImpl(List<String> fileLocs, Config config);  JAXBConfigImpl(String fileLoc);  JAXBConfigImpl(List<String> fileLocs);  JAXBConfigImpl(Properties properties);  JAXBConfigImpl(String fileLoc, Properties properties);  JAXBConfigImpl(List<String> fileLocs, Properties properties); }
JAXBConfigImpl extends AbstractBaseConfig { protected String replaceVariable(String name, String value) { String regex = "(?:\\$\\{" + name + "\\})"; String temporary = null; if (value.contains("${" + name + "}")) { if ((temporary = rawProperties.getProperty(name)) == null) { temporary = System.getProperty(name); } if (temporary != null) { return value.replaceAll(regex, Matcher.quoteReplacement(temporary)); } } return value; } JAXBConfigImpl();  JAXBConfigImpl(Config config);  JAXBConfigImpl(String fileLoc, Config config);  JAXBConfigImpl(List<String> fileLocs, Config config);  JAXBConfigImpl(String fileLoc);  JAXBConfigImpl(List<String> fileLocs);  JAXBConfigImpl(Properties properties);  JAXBConfigImpl(String fileLoc, Properties properties);  JAXBConfigImpl(List<String> fileLocs, Properties properties); @Override Object getObject(String key); @Override Map<String, Object> getObjects(); @Override Properties getProperties(); @Override String getProperty(String key); Properties getRawProperties(); @Override void putProperty(String key, String value); @Override void putProperties(Properties properties); @Override void parseConfig(); boolean isSystemOverride(); void setSystemOverride(boolean systemOverride); @Override void putObject(String key, Object value); @Override void putObjects(Map<String, Object> objects); @Override void removeObject(String key); @Override void removeProperty(String key); @Override void putConfig(Config config); @Override String toString(); }
JAXBConfigImpl extends AbstractBaseConfig { protected String replaceVariable(String name, String value) { String regex = "(?:\\$\\{" + name + "\\})"; String temporary = null; if (value.contains("${" + name + "}")) { if ((temporary = rawProperties.getProperty(name)) == null) { temporary = System.getProperty(name); } if (temporary != null) { return value.replaceAll(regex, Matcher.quoteReplacement(temporary)); } } return value; } JAXBConfigImpl();  JAXBConfigImpl(Config config);  JAXBConfigImpl(String fileLoc, Config config);  JAXBConfigImpl(List<String> fileLocs, Config config);  JAXBConfigImpl(String fileLoc);  JAXBConfigImpl(List<String> fileLocs);  JAXBConfigImpl(Properties properties);  JAXBConfigImpl(String fileLoc, Properties properties);  JAXBConfigImpl(List<String> fileLocs, Properties properties); @Override Object getObject(String key); @Override Map<String, Object> getObjects(); @Override Properties getProperties(); @Override String getProperty(String key); Properties getRawProperties(); @Override void putProperty(String key, String value); @Override void putProperties(Properties properties); @Override void parseConfig(); boolean isSystemOverride(); void setSystemOverride(boolean systemOverride); @Override void putObject(String key, Object value); @Override void putObjects(Map<String, Object> objects); @Override void removeObject(String key); @Override void removeProperty(String key); @Override void putConfig(Config config); @Override String toString();  }