Package com.fizzed.rocker.runtime
Class DefaultRockerTemplate
- java.lang.Object
-
- com.fizzed.rocker.RockerTemplate
-
- com.fizzed.rocker.runtime.DefaultRockerTemplate
-
public abstract class DefaultRockerTemplate extends RockerTemplate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDefaultRockerTemplate.InternalInternal state of a template.
-
Field Summary
Fields Modifier and Type Field Description protected DefaultRockerTemplate.Internal__internal
-
Constructor Summary
Constructors Constructor Description DefaultRockerTemplate(RockerModel model)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void__associate(RockerTemplate context)Associates this template for processing within the context of another template.protected abstract void__doRender()protected RockerOutput__newOutput()Creates a new RockerOutput that the template will render to.RockerOutput__render(DefaultRockerTemplate context, RockerOutputFactory outputFactory)Executes template and renders content to output.Rawraw(java.lang.Object obj)Rawraw(java.lang.String s)-
Methods inherited from class com.fizzed.rocker.RockerTemplate
toString
-
-
-
-
Field Detail
-
__internal
protected DefaultRockerTemplate.Internal __internal
-
-
Constructor Detail
-
DefaultRockerTemplate
public DefaultRockerTemplate(RockerModel model)
-
-
Method Detail
-
__associate
protected void __associate(RockerTemplate context)
Description copied from class:RockerTemplateAssociates this template for processing within the context of another template. This happens when TemplateA calls/includes TemplateB. TemplateB needs to share variables from TemplateA before itself is rendered.- Specified by:
__associatein classRockerTemplate- Parameters:
context- The template calling this template during a render
-
__newOutput
protected RockerOutput __newOutput()
Description copied from class:RockerTemplateCreates a new RockerOutput that the template will render to.- Specified by:
__newOutputin classRockerTemplate- Returns:
- A new RockerOutput
-
__render
public final RockerOutput __render(DefaultRockerTemplate context, RockerOutputFactory outputFactory) throws RenderingException
Executes template and renders content to output.- Parameters:
context- The optional context if this template is being rendered within another templateoutputFactory- Factory for creating output if necessary- 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 abstract void __doRender() throws java.io.IOException, RenderingException- Throws:
java.io.IOExceptionRenderingException
-
raw
public Raw raw(java.lang.Object obj) throws java.io.IOException
- Throws:
java.io.IOException
-
raw
public Raw raw(java.lang.String s) throws java.io.IOException
- Throws:
java.io.IOException
-
-