| |
|
| java.lang.Object org.apache.velocity.context.VMContext
VMContext | public class VMContext implements InternalContextAdapter(Code) | | This is a special, internal-use-only context implementation to be
used for the new Velocimacro implementation.
The main distinguishing feature is the management of the VMProxyArg objects
in the put() and get() methods.
Further, this context also supports the 'VM local context' mode, where
any put() of references that aren't args to the VM are considered
local to the vm, protecting the global context.
author: Geir Magnusson Jr. version: $Id: VMContext.java 471908 2006-11-06 22:39:28Z henning $ |
localcontext | HashMap localcontext(Code) | | container for any local or constant VMProxy items
|
vmproxyhash | HashMap vmproxyhash(Code) | | container for our VMProxy Objects
|
addVMProxyArg | public void addVMProxyArg(VMProxyArg vmpa) throws MethodInvocationException(Code) | | Used to put VMProxyArgs into this context. It separates
the VMProxyArgs into constant and non-constant types
pulling out the value of the constant types so they can
be modified w/o damaging the VMProxyArg, and leaving the
dynamic ones, as they modify context rather than their own
state
Parameters: vmpa - VMProxyArg to add throws: MethodInvocationException - |
get | public Object get(String key)(Code) | | Impl of the Context.gut() method.
Parameters: key - name of item to get stored object or null |
getInternalUserContext | public Context getInternalUserContext()(Code) | | Return the inner / user context.
The inner / user context. |
localPut | public Object localPut(String key, Object value)(Code) | | Allows callers to explicitly put objects in the local context,
no matter what the velocimacro.context.local setting says. Needed
e.g. for loop variables in foreach.
Parameters: key - name of item to set. Parameters: value - object to set to key. old stored object |
put | public Object put(String key, Object value)(Code) | | Impl of the Context.put() method.
Parameters: key - name of item to set Parameters: value - object to set to key old stored object |
put | protected Object put(String key, Object value, boolean forceLocal)(Code) | | Internal put method to select between local and global scope.
Parameters: key - name of item to set Parameters: value - object to set to key Parameters: forceLocal - True forces the object into the local scope. old stored object |
|
|
|