- All Known Implementing Classes:
ExampleModelRenderer
,HelloModelAndViewView
,HelloModelView
,HelloModelView
,MessagePageRenderer
,MessagePageRenderer
- Enclosing interface:
- JStachioFilter
public static interface JStachioFilter.FilterChain
A fully composed chain that renders a model by applying filtering.
- Author:
- agentgt
- API Note
- The filter chain should be stateless and threadsafe as there is no
guarantee that a filter chain will be recreated for the same
TemplateInfo
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
A marker method that the filter is broken and should not be used.static JStachioFilter.FilterChain
of
(JStachioFilter filter, TemplateInfo template) Create the filter chain from the filter and a template by resolving the first filter.void
Renders the passed in model.static Template<?>
toTemplate
(JStachioFilter.FilterChain chain, TemplateInfo templateInfo) Converts the filter chain into a template if it is not already one.
-
Method Details
-
process
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 appendableException
-
isBroken
A marker method that the filter is broken and should not be used. This mainly for the filter pipeline to determine if filter should be called.- Parameters:
model
- the model that would be rendered- Returns:
- by default false
-
toTemplate
Converts the filter chain into a template if it is not already one.- Parameters:
chain
- process will be used when the template is executed.templateInfo
- template info to use if the filter chain is not a template.- Returns:
- chain as a template
-
of
Create the filter chain from the filter and a template by resolving the first filter.The first filter (previous) will be broken unless the parameter template is a
JStachioFilter.FilterChain
which generated renderers usually are.- Parameters:
filter
- usually the composite filtertemplate
- info about the template- Returns:
- an advised render function or often the previous render function if no advise is needed.
-