|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.VelocimacroProxy
VelocimacroProxy.java a proxy Directive-derived object to fit with the current directive system
Field Summary | |
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
|
Fields inherited from class org.apache.velocity.runtime.directive.Directive |
rsvc |
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants |
BLOCK, LINE |
Constructor Summary | |
VelocimacroProxy()
|
Method Summary | |
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)
|
Methods inherited from class org.apache.velocity.runtime.directive.Directive |
getColumn, getLine, setLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private 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
Constructor Detail |
public VelocimacroProxy()
Method Detail |
public java.lang.String getName()
getName
in class Directive
public int getType()
getType
in class Directive
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 Directive
java.io.IOException
MethodInvocationException
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws java.lang.Exception
init
in class Directive
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)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |