Class BindableRockerModel

  • All Implemented Interfaces:
    RockerModel

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

      • templatePath

        private final java.lang.String templatePath
      • templateClassName

        private final java.lang.String templateClassName
    • Constructor Detail

      • BindableRockerModel

        public BindableRockerModel​(java.lang.String templatePath,
                                   java.lang.String templateClassName,
                                   RockerModel model)
    • Method Detail

      • bind

        public BindableRockerModel bind​(java.util.Map<java.lang.String,​java.lang.Object> values)
      • relaxedBind

        public BindableRockerModel relaxedBind​(java.util.Map<java.lang.String,​java.lang.Object> values)
      • 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.