|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.runtime.directive.VMProxyArg
public class VMProxyArg
The function of this class is to proxy for the calling parameter to the VM. This class is designed to be used in conjunction with the VMContext class which knows how to get and set values via it, rather than a simple get() or put() from a hashtable-like object. There is probably a lot of undocumented subtlty here, so step lightly. We rely on the observation that an instance of this object has a constant state throughout its lifetime as it's bound to the use-instance of a VM. In other words, it's created by the VelocimacroProxy class, to represent one of the arguments to a VM in a specific template. Since the template is fixed (it's a file...), we don't have to worry that the args to the VM will change. Yes, the VM will be called in other templates, or in other places on the same template, bit those are different use-instances. These arguments can be, in the lingo of the parser, one of :
Constructor Summary | |
---|---|
VMProxyArg(RuntimeServices rs,
String contextRef,
String callerRef,
int t)
ctor for current impl takes the reference literal we are proxying for, the literal the VM we are for is called with... |
|
VMProxyArg(VMProxyArg model,
InternalContextAdapter c)
not used in current impl Constructor for alternate impl where VelProxy class would make new VMProxyArg objects, and use this contructor to avoid reparsing the reference args that impl also had the VMProxyArg carry it's context |
Method Summary | |
---|---|
String |
getCallerReference()
|
String |
getContextReference()
|
SimpleNode |
getNodeTree()
|
Object |
getObject(InternalContextAdapter context)
returns the value of the reference. |
Object |
getStaticObject()
|
int |
getType()
|
boolean |
isConstant()
tells if arg we are poxying for is dynamic or constant. |
Object |
setObject(InternalContextAdapter context,
Object o)
Invoked by VMContext when Context.put() is called for a proxied reference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VMProxyArg(RuntimeServices rs, String contextRef, String callerRef, int t)
contextRef
- reference arg in the definition of the VM, used in the VMcallerRef
- reference used by the caller as an arg to the VMt
- type of arg : JJTREFERENCE, JJTTRUE, etcpublic VMProxyArg(VMProxyArg model, InternalContextAdapter c)
Method Detail |
---|
public boolean isConstant()
public Object setObject(InternalContextAdapter context, Object o)
context
- context to modify via direct placement, or AST.setValue()o
- new value of reference
public Object getObject(InternalContextAdapter context)
context
- Context to use for getting current value
public String getCallerReference()
public String getContextReference()
public SimpleNode getNodeTree()
public Object getStaticObject()
public int getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |