Package manifold.templates.rt.runtime
Class BaseTemplate
- java.lang.Object
-
- manifold.templates.rt.runtime.BaseTemplate
-
- Direct Known Subclasses:
TestTemplateSuperClass
public abstract class BaseTemplate extends Object
The base class for all generated template classes. You can derive your own base class from this one to provide application-specific functionality.
-
-
Constructor Summary
Constructors Constructor Description BaseTemplate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidafterRender(Appendable buffer, ILayout override, boolean topLevelTemplate, long renderTime)protected voidbeforeRender(Appendable buffer, ILayout override, boolean topLevelTemplate)protected ILayoutgetExplicitLayout()protected ILayoutgetTemplateLayout()protected abstract InputStreamgetTemplateResourceAsStream()Open anInputStreamfor the template resource file in the classpath/module-path.protected StringgetTemplateText()Returns the raw content of the template resource file at runtime.protected voidhandleException(Exception e, String fileName, int lineStart, int[] templateLineNumbers)protected voidsetLayout(ILayout layout)StringtoS(Object o)
-
-
-
Method Detail
-
getTemplateResourceAsStream
protected abstract InputStream getTemplateResourceAsStream()
Open anInputStreamfor the template resource file in the classpath/module-path.To be implemented internally by the generated template.
-
getTemplateText
protected String getTemplateText()
Returns the raw content of the template resource file at runtime.If the template is hard-coded in a test and there is no template resource file, the generated template class overrides this method to return the test-provided text directly.
-
setLayout
protected void setLayout(ILayout layout)
-
getTemplateLayout
protected ILayout getTemplateLayout()
-
getExplicitLayout
protected ILayout getExplicitLayout()
-
beforeRender
protected void beforeRender(Appendable buffer, ILayout override, boolean topLevelTemplate) throws IOException
- Throws:
IOException
-
afterRender
protected void afterRender(Appendable buffer, ILayout override, boolean topLevelTemplate, long renderTime) throws IOException
- Throws:
IOException
-
handleException
protected void handleException(Exception e, String fileName, int lineStart, int[] templateLineNumbers)
-
-