@Test public void testGetText() throws Exception { Map<Object, Object> args = new HashMap<Object, Object>(); args.putAll(System.getenv()); args.putAll(System.getProperties()); args.put("df","df-value"); String text = new ParamText(StringUtil.trim("abc${df}df${df}xxx")).getText(args); System.out.println(text); }
public String getText(Object[] args) { StringBuffer buffer = new StringBuffer(); for (int i = 0, idx = 0; i < tokenList.size(); i++) { Object o = tokenList.get(i); if (o instanceof STRING) { if (idx < args.length) buffer.append(args[idx++]); else buffer.append(o); } else { buffer.append(o); } } return buffer.toString(); }
ParamText { public String getText(Object[] args) { StringBuffer buffer = new StringBuffer(); for (int i = 0, idx = 0; i < tokenList.size(); i++) { Object o = tokenList.get(i); if (o instanceof STRING) { if (idx < args.length) buffer.append(args[idx++]); else buffer.append(o); } else { buffer.append(o); } } return buffer.toString(); } }
ParamText { public String getText(Object[] args) { StringBuffer buffer = new StringBuffer(); for (int i = 0, idx = 0; i < tokenList.size(); i++) { Object o = tokenList.get(i); if (o instanceof STRING) { if (idx < args.length) buffer.append(args[idx++]); else buffer.append(o); } else { buffer.append(o); } } return buffer.toString(); } ParamText(String plainText);  ParamText(String plainText, String startBrace, String endBrace); }
ParamText { public String getText(Object[] args) { StringBuffer buffer = new StringBuffer(); for (int i = 0, idx = 0; i < tokenList.size(); i++) { Object o = tokenList.get(i); if (o instanceof STRING) { if (idx < args.length) buffer.append(args[idx++]); else buffer.append(o); } else { buffer.append(o); } } return buffer.toString(); } ParamText(String plainText);  ParamText(String plainText, String startBrace, String endBrace); String getText(Object[] args); String getText(Object arg); String getText(Map<String, ?> argm); List<String> getKeyList(); String toString(); }
ParamText { public String getText(Object[] args) { StringBuffer buffer = new StringBuffer(); for (int i = 0, idx = 0; i < tokenList.size(); i++) { Object o = tokenList.get(i); if (o instanceof STRING) { if (idx < args.length) buffer.append(args[idx++]); else buffer.append(o); } else { buffer.append(o); } } return buffer.toString(); } ParamText(String plainText);  ParamText(String plainText, String startBrace, String endBrace); String getText(Object[] args); String getText(Object arg); String getText(Map<String, ?> argm); List<String> getKeyList(); String toString();  }