Class BindableRockerModel

java.lang.Object
com.fizzed.rocker.BindableRockerModel
All Implemented Interfaces:
RockerModel

public class BindableRockerModel extends Object implements RockerModel
Wraps a template model to allow fields to be set dynamically via reflection.
  • Field Details

    • templatePath

      private final String templatePath
    • templateClassName

      private final String templateClassName
    • model

      private final RockerModel model
  • Constructor Details

    • BindableRockerModel

      public BindableRockerModel(String templatePath, String templateClassName, RockerModel model)
  • Method Details

    • bind

      public BindableRockerModel bind(Map<String,Object> values)
    • relaxedBind

      public BindableRockerModel relaxedBind(Map<String,Object> values)
    • bind

      public BindableRockerModel bind(String name, Object value)
    • render

      public RockerOutput render() throws RenderingException
      Description copied from interface: RockerModel
      Executes a template model and renders content to output. Single use only.
      Specified by:
      render in interface RockerModel
      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: RockerModel
      Executes a template model and renders content to output. Single use only.
      Specified by:
      render in interface RockerModel
      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: RockerModel
      Executes a template model and renders content to output. Single use only.
      Specified by:
      render in interface RockerModel
      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

      public RockerModel getModel()
    • __body

      public BindableRockerModel __body(RockerContent __body)
      Do not use this method in your controller code. Intended for internal use.