public class VelocimacroProxy extends Directive
BLOCK, LINE| 构造器和说明 |
|---|
VelocimacroProxy() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkArgs(InternalContextAdapter context,
Node node,
boolean hasBody)
check if we are calling this macro with the right number of arguments.
|
java.lang.String |
getName()
Return name of this Velocimacro.
|
int |
getNumArgs()
returns the number of ars needed for this VM
|
int |
getType()
Velocimacros are always LINE type directives.
|
void |
init(RuntimeServices rs)
Initialize members of VelocimacroProxy.
|
boolean |
render(InternalContextAdapter context,
java.io.Writer writer,
Node node)
How this directive is to be rendered
|
boolean |
render(InternalContextAdapter context,
java.io.Writer writer,
Node node,
Renderable body)
Renders the macro using the context.
|
void |
setArgArray(java.lang.String[] arr)
sets the array of arguments specified in the macro definition
|
void |
setName(java.lang.String name)
sets the directive name of this VM
|
void |
setNodeTree(SimpleNode tree) |
getColumn, getLine, getScopeName, getTemplateName, init, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocationpublic java.lang.String getName()
public int getType()
public void setName(java.lang.String name)
name - public void setArgArray(java.lang.String[] arr)
arr - public void setNodeTree(SimpleNode tree)
tree - public int getNumArgs()
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException, MethodInvocationException, MacroOverflowException
Directiverender 在类中 Directivejava.io.IOExceptionMethodInvocationExceptionMacroOverflowExceptionpublic boolean render(InternalContextAdapter context, java.io.Writer writer, Node node, Renderable body) throws java.io.IOException, MethodInvocationException, MacroOverflowException
context - Current rendering contextwriter - Writer for outputnode - AST that calls the macrojava.io.IOExceptionMethodInvocationExceptionMacroOverflowExceptionpublic void init(RuntimeServices rs)
public void checkArgs(InternalContextAdapter context, Node node, boolean hasBody)