org.apache.velocity.runtime.directive
public class VelocimacroProxy extends Directive
BLOCK, LINE
Constructor and Description |
---|
VelocimacroProxy() |
Modifier and Type | Method and Description |
---|---|
void |
checkArgs(InternalContextAdapter context,
Node node,
boolean hasBody)
check if we are calling this macro with the right number of arguments.
|
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,
Writer writer,
Node node)
How this directive is to be rendered
|
boolean |
render(InternalContextAdapter context,
Writer writer,
Node node,
Renderable body)
Renders the macro using the context.
|
void |
setArgArray(String[] arr)
sets the array of arguments specified in the macro definition
|
void |
setName(String name)
sets the directive name of this VM
|
void |
setNodeTree(SimpleNode tree) |
getColumn, getLine, getScopeName, getTemplateName, init, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
public String getName()
public int getType()
public void setName(String name)
name
- public void setArgArray(String[] arr)
arr
- public void setNodeTree(SimpleNode tree)
tree
- public int getNumArgs()
public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, MethodInvocationException, MacroOverflowException
Directive
render
in class Directive
IOException
MethodInvocationException
MacroOverflowException
public boolean render(InternalContextAdapter context, Writer writer, Node node, Renderable body) throws IOException, MethodInvocationException, MacroOverflowException
context
- Current rendering contextwriter
- Writer for outputnode
- AST that calls the macroIOException
MethodInvocationException
MacroOverflowException
public void init(RuntimeServices rs)
public void checkArgs(InternalContextAdapter context, Node node, boolean hasBody)
Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.