XmlGenerator implements Generator { @Override public Optional<String> on(Object model) { return inner.on(model); } XmlGenerator(); static Generator forJava(); @Override DependencyManager getDependencyMgr(); @Override RenderStack getRenderStack(); @Override Stream<Meta<A, B>> metaOn(A from, Class<B> to); @Override Stream<Meta<A, B>> metaOn(A from, Class<B> to, Class<? extends Transform<A, B>> transform); @Override Stream<Meta<M, String>> metaOn(M model); @Override Stream<Meta<A, String>> metaOn(Collection<A> models); @Override Stream<Meta<A, B>> metaOn(Collection<A> models, Class<B> to); @Override Stream<Meta<A, B>> metaOn(Collection<A> models, Class<B> to, Class<? extends Transform<A, B>> transform); @Override Optional<String> on(Object model); @Override Stream<String> onEach(Collection<M> models); @Override Optional<Meta<A, B>> transform(Transform<A, B> transform, A model, TransformFactory factory);  }
@Test void testSimpleHTML() { final Document doc = Document.html( html() .add(head() .add(title().add("Welcome")) ).add(body() .add("The content of the document") ) ); Formatting.tab(" "); final String html = new XmlGenerator().on(doc).get(); assertTrue(html.contains("Welcome")); }
@Test void testSimpleXML() { final Document doc = Document.xml( TagElement.of("project") .add(TagElement.of("dependencies") .add(TagElement.of("dependency").add("Speedment")) ) ); Formatting.tab(" "); final String html = new XmlGenerator().on(doc).get(); assertTrue(html.contains("Speedment")); }
@Test void on() { assertNotNull(generator.on("")); }