@Test public void testMapVariable() { String template = "Hello {{ m.a }} and {{ m.b }}!"; Map<String, Object> nested = ImmutableMap.of("a", "XX", "b", "YY"); Map<String, Object> args = ImmutableMap.of("m", nested); assertEquals("Hello XX and YY!", TemplateProcessor.process(template, args)); }
public static String process(String template, Map<String, Object> args) { return new TemplateProcessor(template).process(args); }
TemplateProcessor { public static String process(String template, Map<String, Object> args) { return new TemplateProcessor(template).process(args); } }
TemplateProcessor { public static String process(String template, Map<String, Object> args) { return new TemplateProcessor(template).process(args); } TemplateProcessor(String template); }
TemplateProcessor { public static String process(String template, Map<String, Object> args) { return new TemplateProcessor(template).process(args); } TemplateProcessor(String template); static String process(String template, Map<String, Object> args); String process(Map<String, Object> args); }
TemplateProcessor { public static String process(String template, Map<String, Object> args) { return new TemplateProcessor(template).process(args); } TemplateProcessor(String template); static String process(String template, Map<String, Object> args); String process(Map<String, Object> args);  }