Package htmlflow
Class DynamicHtml<T>
- java.lang.Object
-
- htmlflow.HtmlView<T>
-
- htmlflow.DynamicHtml<T>
-
- Type Parameters:
T- The type of domain object bound to this View.
- All Implemented Interfaces:
HtmlWriter<T>,org.xmlet.htmlapifaster.Element<HtmlView<T>,org.xmlet.htmlapifaster.Element<?,?>>
public class DynamicHtml<T> extends HtmlView<T>
Dynamic views can be bound to a domain object.- Author:
- Miguel Gamboa, Luís Duare
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HtmlView<T>clone(HtmlVisitorCache visitor)Resulting in a non thread safe view.protected HtmlView<T>clone(Supplier<HtmlVisitorCache> visitorSupplier, boolean threadSafe)Since HtmlView is immutable this is the preferred way to create a copy of the existing HtmlView instance with a different threadSafe state.Stringrender()Returns a new String with the HTML content of this view.Stringrender(T model)Returns a new String with the HTML content of this view.Stringrender(T model, HtmlView... partials)static <U> DynamicHtml<U>view(HtmlTemplate<U> template)static <U> DynamicHtml<U>view(PrintStream out, HtmlTemplate<U> template)static <U> DynamicHtml<U>view(PrintStream out, BiConsumer<DynamicHtml<U>,U> binder)static <U> DynamicHtml<U>view(BiConsumer<DynamicHtml<U>,U> binder)voidwrite()Writes into an internal PrintStream the HTML content.voidwrite(T model)Writes into an internal PrintStream the HTML content binding the object model with the HTML elements.voidwrite(T model, HtmlView... partials)-
Methods inherited from class htmlflow.HtmlView
__, addPartial, addPartial, defineRoot, div, getName, getParent, getVisitor, html, self, setIndented, setPrintStream, threadSafe, tr
-
-
-
-
Method Detail
-
view
public static <U> DynamicHtml<U> view(PrintStream out, HtmlTemplate<U> template)
-
view
public static <U> DynamicHtml<U> view(PrintStream out, BiConsumer<DynamicHtml<U>,U> binder)
-
view
public static <U> DynamicHtml<U> view(HtmlTemplate<U> template)
-
view
public static <U> DynamicHtml<U> view(BiConsumer<DynamicHtml<U>,U> binder)
-
render
public final String render()
Description copied from interface:HtmlWriterReturns a new String with the HTML content of this view.
-
render
public final String render(T model)
Description copied from interface:HtmlWriterReturns a new String with the HTML content of this view.- Parameters:
model- An object model that could be bind to each element of the view.
-
write
public final void write()
Description copied from interface:HtmlWriterWrites into an internal PrintStream the HTML content.
-
write
public final void write(T model)
Description copied from interface:HtmlWriterWrites into an internal PrintStream the HTML content binding the object model with the HTML elements.- Parameters:
model- An object model that could be bind to each element.
-
clone
protected final HtmlView<T> clone(Supplier<HtmlVisitorCache> visitorSupplier, boolean threadSafe)
Since HtmlView is immutable this is the preferred way to create a copy of the existing HtmlView instance with a different threadSafe state.
-
-