@Test public void t3() { Map<String, Object> attrs = new HashMap<>(4); attrs.put("a", 1); attrs.put("b", "text"); String template = "a + 2 = ${a + 2}; b = ${b.substring(1)};"; String value = engine.render(template, attrs); Assert.assertEquals("a + 2 = 3; b = ext;", value); }
@Override public String render(String template, Map<String, Object> attrs) { StringWriter writer = new StringWriter(); render(template, attrs, writer); return writer.toString(); }
SimpleTemplateEngine implements TemplateEngine { @Override public String render(String template, Map<String, Object> attrs) { StringWriter writer = new StringWriter(); render(template, attrs, writer); return writer.toString(); } }
SimpleTemplateEngine implements TemplateEngine { @Override public String render(String template, Map<String, Object> attrs) { StringWriter writer = new StringWriter(); render(template, attrs, writer); return writer.toString(); }  }
SimpleTemplateEngine implements TemplateEngine { @Override public String render(String template, Map<String, Object> attrs) { StringWriter writer = new StringWriter(); render(template, attrs, writer); return writer.toString(); }  @Override String render(String template, Map<String, Object> attrs); @Override void render(String template, Map<String, Object> attrs, Writer writer); }
SimpleTemplateEngine implements TemplateEngine { @Override public String render(String template, Map<String, Object> attrs) { StringWriter writer = new StringWriter(); render(template, attrs, writer); return writer.toString(); }  @Override String render(String template, Map<String, Object> attrs); @Override void render(String template, Map<String, Object> attrs, Writer writer);  }