| org.apache.velocity.context.AbstractContext org.apache.velocity.VelocityContext
All known Subclasses: org.apache.dvsl.DVSLNodeContext, org.apache.velocity.tools.view.context.ChainedContext, org.apache.dvsl.DVSLContext,
VelocityContext | public class VelocityContext extends AbstractContext implements Cloneable(Code) | | General purpose implemention of the application Context
interface for general application use. This class should
be used in place of the original Context class.
This implementation uses a HashMap (@see java.util.HashMap )
for data storage.
This context implementation cannot be shared between threads
without those threads synchronizing access between them, as
the HashMap is not synchronized, nor are some of the fundamentals
of AbstractContext. If you need to share a Context between
threads with simultaneous access for some reason, please create
your own and extend the interface Context
See Also: org.apache.velocity.context.Context author: Geir Magnusson Jr. author: Jason van Zyl author: Fedor Karpelevitch author: Daniel Rall version: $Id: VelocityContext.java 463298 2006-10-12 16:10:32Z henning $ |
Constructor Summary | |
public | VelocityContext() Creates a new instance (with no inner context). | public | VelocityContext(Map context) Creates a new instance with the provided storage (and no inner
context). | public | VelocityContext(Context innerContext) Chaining constructor, used when you want to
wrap a context in another. | public | VelocityContext(Map context, Context innerContext) Initializes internal storage (never to null ), and
inner context. |
VelocityContext | public VelocityContext()(Code) | | Creates a new instance (with no inner context).
|
VelocityContext | public VelocityContext(Map context)(Code) | | Creates a new instance with the provided storage (and no inner
context).
Parameters: context - |
VelocityContext | public VelocityContext(Context innerContext)(Code) | | Chaining constructor, used when you want to
wrap a context in another. The inner context
will be 'read only' - put() calls to the
wrapping context will only effect the outermost
context
Parameters: innerContext - The Context implementation towrap. |
VelocityContext | public VelocityContext(Map context, Context innerContext)(Code) | | Initializes internal storage (never to null ), and
inner context.
Parameters: context - Internal storage, or null tocreate default storage. Parameters: innerContext - Inner context. |
clone | public Object clone()(Code) | | Clones this context object.
A deep copy of this Context . |
internalContainsKey | public boolean internalContainsKey(Object key)(Code) | | determines if there is a value for the
given key
Parameters: key - name of value to check true if non-null value in store |
internalGet | public Object internalGet(String key)(Code) | | retrieves value for key from internal
storage
Parameters: key - name of value to get value as object |
internalGetKeys | public Object[] internalGetKeys()(Code) | | returns array of keys
keys as [] |
internalPut | public Object internalPut(String key, Object value)(Code) | | stores the value for key to internal
storage
Parameters: key - name of value to store Parameters: value - value to store previous value of key as Object |
internalRemove | public Object internalRemove(Object key)(Code) | | remove a key/value pair from the
internal storage
Parameters: key - name of value to remove value removed |
|
|