StplTemplate { public static String render(String template,Map<String, Object> params){ return parse(template).render(params); } StplTemplate(final String text,final StplNode[] nodes); static StplTemplate parse(String text); static String render(String template,Map<String, Object> params); static String render(String template,Params params); String getText(); String render(Params params); String render(Map<String, Object> params); void render(StringBuilder out,Params params); void render(StringBuilder out,Map<String, Object> params);  }
@Test public void testSimpleStplTemplate(){ assertEquals("test", render("test",new HashMap<String,Object>())); assertEquals("test", render("$var$",New.<String,Object>hashMap("var", "test"))); assertEquals("test1", render("$var$1",New.<String,Object>hashMap("var", "test"))); assertEquals("test1", render("$var$1{?$var1$}",New.<String,Object>hashMap("var", "test"))); assertEquals("test1test2", render("$var$1{?$var1$}",New.<String,Object>hashMap("var", "test","var1","test2"))); }