Constructor and Description |
---|
MacroFromContext(TemplateInterpreter interpreter,
String name,
TinyTemplateParser.BlockContext blockContext,
TemplateFromContext templateFromContext) |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(String parameterName,
EvaluateExpression defaultValue) |
String |
getAbsolutePath() |
long |
getLastModifiedTime() |
String |
getMacroPath()
获得宏文件路径
|
String |
getName()
返回宏的名字
|
List<EvaluateExpression> |
getParameterDefaultValues()
返回宏的参数的默认值
|
String |
getParameterName(int index)
返回指定索引的参数名,如果越界,则返回null
|
List<String> |
getParameterNames()
返回宏的参数名称
|
TemplateEngine |
getTemplateEngine()
获得模板引擎
|
void |
render(Template templateFromContext,
TemplateContext pageContext,
TemplateContext context,
OutputStream outputStream)
进行渲染
|
void |
setAbsolutePath(String path) |
void |
setLastModifiedTime(long time) |
void |
setMacroPath(String macroPath)
设置宏文件路径
|
void |
setTemplateEngine(TemplateEngine engine)
设置模板引擎
|
public MacroFromContext(TemplateInterpreter interpreter, String name, TinyTemplateParser.BlockContext blockContext, TemplateFromContext templateFromContext)
public List<String> getParameterNames()
Macro
getParameterNames
in interface Macro
public void addParameter(String parameterName, EvaluateExpression defaultValue)
public String getParameterName(int index)
Macro
getParameterName
in interface Macro
public List<EvaluateExpression> getParameterDefaultValues()
Macro
getParameterDefaultValues
in interface Macro
public TemplateEngine getTemplateEngine()
Macro
getTemplateEngine
in interface Macro
public void setTemplateEngine(TemplateEngine engine)
Macro
setTemplateEngine
in interface Macro
public void render(Template templateFromContext, TemplateContext pageContext, TemplateContext context, OutputStream outputStream) throws TemplateException
Macro
render
in interface Macro
TemplateException
public String getMacroPath()
Macro
getMacroPath
in interface Macro
public void setMacroPath(String macroPath)
Macro
setMacroPath
in interface Macro
public long getLastModifiedTime()
getLastModifiedTime
in interface Updatable
public void setLastModifiedTime(long time)
setLastModifiedTime
in interface Updatable
public String getAbsolutePath()
getAbsolutePath
in interface Updatable
public void setAbsolutePath(String path)
setAbsolutePath
in interface Updatable
Copyright © 2006–2018 TinyGroup. All rights reserved.