Package com.fizzed.rocker.runtime
Class DefaultRockerModel
- java.lang.Object
-
- com.fizzed.rocker.runtime.DefaultRockerModel
-
- All Implemented Interfaces:
RockerModel
public class DefaultRockerModel extends java.lang.Object implements RockerModel
-
-
Field Summary
Fields Modifier and Type Field Description private booleanrendered
-
Constructor Summary
Constructors Constructor Description DefaultRockerModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DefaultRockerTemplatebuildTemplate()protected RockerOutputdoRender(DefaultRockerTemplate context, RockerOutputFactory outputFactory, RockerTemplateCustomizer templateCustomizer)RockerOutputrender()Renders model and template content to output.<O extends RockerOutput>
Orender(RockerOutputFactory<O> outputFactory)Executes a template model and renders content to output.<O extends RockerOutput>
Orender(RockerOutputFactory<O> outputFactory, RockerTemplateCustomizer templateCustomizer)Executes a template model and renders content to output.java.lang.StringtoString()
-
-
-
Method Detail
-
render
public RockerOutput render() throws RenderingException
Renders model and template content to output. Single use only.- Specified by:
renderin interfaceRockerModel- Returns:
- The output of rendering process
- Throws:
RenderingException- Thrown if any error encountered while rendering template. Exception will include underlying cause as well as line and position of original template source that triggered exception.
-
render
public <O extends RockerOutput> O render(RockerOutputFactory<O> outputFactory) throws RenderingException
Description copied from interface:RockerModelExecutes a template model and renders content to output. Single use only.- Specified by:
renderin interfaceRockerModel- Type Parameters:
O- The output type- Parameters:
outputFactory- A factory to create a new RockerOutput. If null then the a default defined by the template will be used instead.- Returns:
- The output of rendering process
- Throws:
RenderingException- Thrown if any error encountered while rendering template. Exception will include underlying cause as well as line and position of original template source that triggered exception.
-
render
public <O extends RockerOutput> O render(RockerOutputFactory<O> outputFactory, RockerTemplateCustomizer templateCustomizer) throws RenderingException
Description copied from interface:RockerModelExecutes a template model and renders content to output. Single use only.- Specified by:
renderin interfaceRockerModel- Type Parameters:
O- The output type- Parameters:
outputFactory- A factory to create a new RockerOutput. If null then the a default defined by the template will be used instead.templateCustomizer- A customizer for last second changes to template between the time its built and the time it actually is rendered. Useful for injecting implicit variables in frameworks. If null then no customization will be done.- Returns:
- The output of rendering process
- Throws:
RenderingException- Thrown if any error encountered while rendering template. Exception will include underlying cause as well as line and position of original template source that triggered exception.
-
doRender
protected RockerOutput doRender(DefaultRockerTemplate context, RockerOutputFactory outputFactory, RockerTemplateCustomizer templateCustomizer) throws RenderingException
- Throws:
RenderingException
-
buildTemplate
protected DefaultRockerTemplate buildTemplate() throws RenderingException
- Throws:
RenderingException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-