org.apache.velocity.context
Class VMContext
java.lang.Object
org.apache.velocity.context.VMContext
- Context, InternalContextAdapter, InternalEventContext, InternalHousekeepingContext, InternalWrapperContext
public class VMContext
extends java.lang.Object
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 get() or put() of references that aren't args to the VM are considered
local to the vm, protecting the global context.
Version:
- Geir Magnusson Jr.
innerContext
(package private) InternalContextAdapter innerContext
the base context store. This is the 'global' context
localcontext
(package private) HashMap localcontext
container for any local or constant VMProxy items
localcontextscope
private boolean localcontextscope
support for local context scope feature, where all references are local
vmproxyhash
(package private) HashMap vmproxyhash
container for our VMProxy Objects
addVMProxyArg
public void addVMProxyArg(VMProxyArg vmpa)
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
vmpa
- VMProxyArg to add
containsKey
public boolean containsKey(Object key)
not yet impl
- containsKey in interface Context
get
public Object get(String key)
Impl of the Context.gut() method.
- get in interface Context
key
- name of item to get
- stored object or null
getKeys
public Object[] getKeys()
impl badly
- getKeys in interface Context
put
public Object put(String key,
Object value)
Impl of the Context.put() method.
- put in interface Context
key
- name of item to setvalue
- object to set to key
- old stored object
remove
public Object remove(Object key)
impl badly
- remove in interface Context
Copyright © 2003 Apache Software Foundation. All Rights Reserved.