@Test public void testDictionary() throws IOException { TemplateEncoder encoder = new TemplateEncoder(getClass().getResource("dictionary.txt")); Map<String, ?> dictionary = mapOf( entry("a", "hello"), entry("b", 42), entry("c", mapOf( entry("d", false) )) ); String result; try (StringWriter writer = new StringWriter()) { encoder.write(dictionary, writer); result = writer.toString(); } assertEquals(String.format("{a=%s,b=%s,c.d=%s,e=,f.g=}", dictionary.get("a"), dictionary.get("b"), ((Map<?, ?>)dictionary.get("c")).get("d")), 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();  }