@Test public void testMultiElementSection() throws IOException { TemplateEncoder encoder = new TemplateEncoder(getClass().getResource("section1.txt")); Map<String, ?> dictionary1 = mapOf( entry("a", "hello"), entry("b", 1L), entry("c", 2.0)); Map<String, ?> dictionary2 = mapOf( entry("a", "goodbye"), entry("b", 2L), entry("c", 4.0)); List<?> list = listOf(dictionary1, dictionary2); String result; try (StringWriter writer = new StringWriter()) { encoder.write(mapOf(entry("list", list)), writer); result = writer.toString(); } assertEquals(String.format("[{a=%s,b=%s,c=%s}{a=%s,b=%s,c=%s}]", dictionary1.get("a"), dictionary1.get("b"), dictionary1.get("c"), dictionary2.get("a"), dictionary2.get("b"), dictionary2.get("c")), result); }
@Override public void write(Object value, OutputStream outputStream) throws IOException { write(value, outputStream, Locale.getDefault()); }
TemplateEncoder extends Encoder<Object> { @Override public void write(Object value, OutputStream outputStream) throws IOException { write(value, outputStream, Locale.getDefault()); } }
TemplateEncoder extends Encoder<Object> { @Override public void write(Object value, OutputStream outputStream) throws IOException { write(value, outputStream, Locale.getDefault()); } TemplateEncoder(URL url);  TemplateEncoder(URL url, Charset charset); }
TemplateEncoder extends Encoder<Object> { @Override public void write(Object value, OutputStream outputStream) throws IOException { write(value, outputStream, Locale.getDefault()); } TemplateEncoder(URL url);  TemplateEncoder(URL url, Charset charset); Map<String, Modifier> getModifiers(); String getBaseName(); void setBaseName(String baseName); Map<String, ?> getContext(); void setContext(Map<String, ?> context); @Override void write(Object value, OutputStream outputStream); void write(Object value, OutputStream outputStream, Locale locale); void write(Object value, OutputStream outputStream, Locale locale, TimeZone timeZone); @Override void write(Object value, Writer writer); void write(Object value, Writer writer, Locale locale); void write(Object value, Writer writer, Locale locale, TimeZone timeZone); static Map<String, Modifier> getDefaultModifiers(); }
TemplateEncoder extends Encoder<Object> { @Override public void write(Object value, OutputStream outputStream) throws IOException { write(value, outputStream, Locale.getDefault()); } TemplateEncoder(URL url);  TemplateEncoder(URL url, Charset charset); Map<String, Modifier> getModifiers(); String getBaseName(); void setBaseName(String baseName); Map<String, ?> getContext(); void setContext(Map<String, ?> context); @Override void write(Object value, OutputStream outputStream); void write(Object value, OutputStream outputStream, Locale locale); void write(Object value, OutputStream outputStream, Locale locale, TimeZone timeZone); @Override void write(Object value, Writer writer); void write(Object value, Writer writer, Locale locale); void write(Object value, Writer writer, Locale locale, TimeZone timeZone); static Map<String, Modifier> getDefaultModifiers();  }