public class TemplateFromContext extends AbstractTemplate
templateEngine
Constructor and Description |
---|
TemplateFromContext(String path,
TinyTemplateParser.TemplateContext templateContext) |
Modifier and Type | Method and Description |
---|---|
<T> T |
getObject(org.antlr.v4.runtime.tree.ParseTree parseTree) |
String |
getPath()
返回模板对应的路径
|
byte[] |
getTerminalNodeBytes(org.antlr.v4.runtime.tree.TerminalNode terminalNode,
TemplateFromContext templateFromContext,
int left,
int right) |
String |
getText(org.antlr.v4.runtime.tree.ParseTree parseTree) |
boolean |
isDirectiveNeedTrim(org.antlr.v4.runtime.tree.ParseTree parseTree)
是否需要Trim其\r\n的指令节点 === Set指令除外
#if #else #elseif #end #eol ${}
#for #foreach #while #break #continue
#macro
#@layout
|
void |
putObject(org.antlr.v4.runtime.tree.ParseTree parseTree,
Object object) |
protected void |
renderContent(TemplateContext context,
OutputStream outputStream) |
addImport, addMacro, getAbsolutePath, getImportPathList, getLastModifiedTime, getMacroMap, getTemplateContext, getTemplateEngine, put, render, render, render, setAbsolutePath, setLastModifiedTime, setTemplateEngine
public TemplateFromContext(String path, TinyTemplateParser.TemplateContext templateContext)
public String getText(org.antlr.v4.runtime.tree.ParseTree parseTree)
public void putObject(org.antlr.v4.runtime.tree.ParseTree parseTree, Object object)
public <T> T getObject(org.antlr.v4.runtime.tree.ParseTree parseTree)
public byte[] getTerminalNodeBytes(org.antlr.v4.runtime.tree.TerminalNode terminalNode, TemplateFromContext templateFromContext, int left, int right) throws TemplateException
TemplateException
public boolean isDirectiveNeedTrim(org.antlr.v4.runtime.tree.ParseTree parseTree)
parseTree
- 当前节点protected void renderContent(TemplateContext context, OutputStream outputStream) throws IOException, TemplateException
renderContent
in class AbstractTemplate
IOException
TemplateException
Copyright © 2006–2018 TinyGroup. All rights reserved.