@Test public void testGet_Map() throws Exception { Map<String, Object> param = new HashMap<>(); param.put("deptno", 30); param.put("job", "SALESMAN"); String result = new FreeMarker().get("ftl/selectByArgs.sql", param); String[] results = result.split("\n"); int i = 0; assertEquals(results[i++], "SELECT"); assertEquals(results[i++], " *"); assertEquals(results[i++], " FROM"); assertEquals(results[i++], " emp"); assertEquals(results[i++], " WHERE"); assertEquals(results[i++], " 1 = 1"); assertEquals(results[i++], " AND job = :job"); assertEquals(results[i++], " AND deptno = :deptno"); assertEquals(i, results.length); }
@Override public String get(String resource, Object args) { Template template = getTemplate(resource); return processTemplate(args, template); }
FreeMarker implements TemplateEngine { @Override public String get(String resource, Object args) { Template template = getTemplate(resource); return processTemplate(args, template); } }
FreeMarker implements TemplateEngine { @Override public String get(String resource, Object args) { Template template = getTemplate(resource); return processTemplate(args, template); }  }
FreeMarker implements TemplateEngine { @Override public String get(String resource, Object args) { Template template = getTemplate(resource); return processTemplate(args, template); }  @Override String get(String resource, Object args); @Override String get(String resource); }
FreeMarker implements TemplateEngine { @Override public String get(String resource, Object args) { Template template = getTemplate(resource); return processTemplate(args, template); }  @Override String get(String resource, Object args); @Override String get(String resource);  }