Package com.fizzed.rocker
Class BindableRockerModel
java.lang.Object
com.fizzed.rocker.BindableRockerModel
- All Implemented Interfaces:
RockerModel
Wraps a template model to allow fields to be set dynamically via reflection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RockerModelprivate final Stringprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionBindableRockerModel(String templatePath, String templateClassName, RockerModel model) -
Method Summary
Modifier and TypeMethodDescription__body(RockerContent __body) Do not use this method in your controller code.getModel()relaxedBind(Map<String, Object> values) render()Executes a template model and renders content to output.<T extends RockerOutput>
Trender(RockerOutputFactory<T> outputFactory) Executes a template model and renders content to output.<T extends RockerOutput>
Trender(RockerOutputFactory<T> outputFactory, RockerTemplateCustomizer templateCustomizer) Executes a template model and renders content to output.
-
Field Details
-
templatePath
-
templateClassName
-
model
-
-
Constructor Details
-
BindableRockerModel
-
-
Method Details
-
bind
-
relaxedBind
-
bind
-
render
Description copied from interface:RockerModelExecutes a template model and renders 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 <T extends RockerOutput> T render(RockerOutputFactory<T> 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:
T- 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 <T extends RockerOutput> T render(RockerOutputFactory<T> 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:
T- 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.
-
getModel
-
__body
Do not use this method in your controller code. Intended for internal use.
-