public class VelocimacroProxy extends Directive
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String[] |
argArray |
private java.lang.String[] |
callingArgs |
private int[] |
callingArgTypes |
private boolean |
init |
private java.lang.String |
macroBody |
private java.lang.String |
macroName |
private java.lang.String |
namespace |
private SimpleNode |
nodeTree |
private int |
numMacroArgs |
private java.util.HashMap |
proxyArgHash |
BLOCK, LINE| Constructor and Description |
|---|
VelocimacroProxy() |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String[] |
getArgArray(Node node)
gets the args to the VM from the instance-use AST
|
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,
InternalContextAdapter context,
Node node)
The major meat of VelocimacroProxy, init() checks the # of arguments, patches the
macro body, renders the macro into an AST, and then inits the AST, so it is ready
for quick rendering.
|
private void |
parseTree(java.lang.String[] callArgs)
parses the macro.
|
boolean |
render(InternalContextAdapter context,
java.io.Writer writer,
Node node)
Renders the macro using the context
|
void |
setArgArray(java.lang.String[] arr)
sets the array of arguments specified in the macro definition
|
void |
setMacrobody(java.lang.String mb)
Sets the orignal macro body.
|
void |
setName(java.lang.String name)
sets the directive name of this VM
|
void |
setNamespace(java.lang.String ns) |
void |
setNodeTree(SimpleNode tree) |
boolean |
setupMacro(java.lang.String[] callArgs,
int[] callArgTypes)
basic VM setup.
|
private void |
setupProxyArgs(java.lang.String[] callArgs,
int[] callArgTypes) |
getColumn, getLine, setLocationprivate java.lang.String macroName
private java.lang.String macroBody
private java.lang.String[] argArray
private SimpleNode nodeTree
private int numMacroArgs
private java.lang.String namespace
private boolean init
private java.lang.String[] callingArgs
private int[] callingArgTypes
private java.util.HashMap proxyArgHash
public java.lang.String getName()
public int getType()
public void setName(java.lang.String name)
public void setArgArray(java.lang.String[] arr)
public void setNodeTree(SimpleNode tree)
public int getNumArgs()
public void setMacrobody(java.lang.String mb)
public void setNamespace(java.lang.String ns)
public boolean render(InternalContextAdapter context, java.io.Writer writer, Node node) throws java.io.IOException, MethodInvocationException
render in class Directivejava.io.IOExceptionMethodInvocationExceptionpublic void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws java.lang.Exception
public boolean setupMacro(java.lang.String[] callArgs,
int[] callArgTypes)
private void parseTree(java.lang.String[] callArgs)
private void setupProxyArgs(java.lang.String[] callArgs,
int[] callArgTypes)
private java.lang.String[] getArgArray(Node node)
Copyright ? 2002 Apache Software Foundation. All Rights Reserved.