- Type Parameters:
T
- the model type
- All Known Implementing Classes:
AbstractJStachio
,HelloModelView
,HelloModelView
,MessagePageRenderer
,MessagePageRenderer
,SpringJStachio
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Renders models of type
T
by writing to an Appendable. Implementations
should be generally stateless and threadsafe.-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Convenience method that directly renders the model as a String.void
execute
(T model, Appendable appendable) Renders the passed in model.default StringBuilder
execute
(T model, StringBuilder sb) A convenience method that does not throwIOException
when using StringBuilder.
-
Method Details
-
execute
Renders the passed in model.- Parameters:
model
- a model assumed never to benull
.appendable
- the appendable to write to.- Throws:
IOException
- if there is an error writing to the appendable
-
execute
A convenience method that does not throwIOException
when using StringBuilder.- Parameters:
model
- a model assumed never to be null.sb
- should never be null.- Returns:
- the passed in
StringBuilder
.
-
execute
Convenience method that directly renders the model as a String.- Parameters:
model
- never null.- Returns:
- the rendered model.
-