Package com.googlecode.jatl
Interface MarkupWriter
-
- All Known Subinterfaces:
MarkupBuilderWriter
- All Known Implementing Classes:
HtmlWriter
public interface MarkupWriterWrap builders for deferred writing.This is useful when you want to define the markup but do not have the
Writeryet.Often this is the case when:
- MVC framework (such as Spring MVC) where the writer is not available till rendering time.
- Composition of builders.
MarkupWriters.private HtmlWriter createInput(final String name, final String value) { return new HtmlWriter() { protected void build() { input().name(name).value(value).end(); } }; } private HtmlWriter createForm(final HtmlWriter ... inputs) { return new HtmlWriter() { protected void build() { form().write(inputs).end(); } }; }SeeMarkupBuilder.write(MarkupWriter...)- See Also:
HtmlWriter,MarkupBuilder.write(MarkupWriter...)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <W extends java.io.Writer>
Wwrite(W writer)Writes using the given writer.
-
-
-
Method Detail
-
write
<W extends java.io.Writer> W write(W writer)
Writes using the given writer. The writer should not be closed and will not be closed by implementations. Its up to the caller to close the writer.- Type Parameters:
W- writer type.- Parameters:
writer- not null.- Returns:
- the writer used for fluent style.
-
-