@Test public void notReplace() { Properties props = new Properties(); props.setProperty(PropertyParser.KEY_ENABLE_DEFAULT_VALUE, "true"); Assertions.assertThat(PropertyParser.parse("${key}", props)).isEqualTo("${key}"); Assertions.assertThat(PropertyParser.parse("${key}", null)).isEqualTo("${key}"); props.setProperty(PropertyParser.KEY_ENABLE_DEFAULT_VALUE, "false"); Assertions.assertThat(PropertyParser.parse("${a:b}", props)).isEqualTo("${a:b}"); props.remove(PropertyParser.KEY_ENABLE_DEFAULT_VALUE); Assertions.assertThat(PropertyParser.parse("${a:b}", props)).isEqualTo("${a:b}"); }
public static String parse(String string, Properties variables) { VariableTokenHandler handler = new VariableTokenHandler(variables); GenericTokenParser parser = new GenericTokenParser("${", "}", handler); return parser.parse(string); }
PropertyParser { public static String parse(String string, Properties variables) { VariableTokenHandler handler = new VariableTokenHandler(variables); GenericTokenParser parser = new GenericTokenParser("${", "}", handler); return parser.parse(string); } }
PropertyParser { public static String parse(String string, Properties variables) { VariableTokenHandler handler = new VariableTokenHandler(variables); GenericTokenParser parser = new GenericTokenParser("${", "}", handler); return parser.parse(string); } private  PropertyParser(); }
PropertyParser { public static String parse(String string, Properties variables) { VariableTokenHandler handler = new VariableTokenHandler(variables); GenericTokenParser parser = new GenericTokenParser("${", "}", handler); return parser.parse(string); } private  PropertyParser(); static String parse(String string, Properties variables); }
PropertyParser { public static String parse(String string, Properties variables) { VariableTokenHandler handler = new VariableTokenHandler(variables); GenericTokenParser parser = new GenericTokenParser("${", "}", handler); return parser.parse(string); } private  PropertyParser(); static String parse(String string, Properties variables); static final String KEY_ENABLE_DEFAULT_VALUE; static final String KEY_DEFAULT_VALUE_SEPARATOR; }