Save This Page
Home » velocity-1.5 » org.apache » velocity » [javadoc | source]
org.apache.velocity
public class: VelocityContext [javadoc | source]
java.lang.Object
   org.apache.velocity.context.InternalContextBase
      org.apache.velocity.context.AbstractContext
         org.apache.velocity.VelocityContext

All Implemented Interfaces:
    Cloneable, Context, InternalHousekeepingContext, InternalEventContext

Direct Known Subclasses:
    ChainedContext, ToolboxContext

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
Constructor:
 public VelocityContext() 
 public VelocityContext(Map context) 
    Creates a new instance with the provided storage (and no inner context).
    Parameters:
    context -
 public VelocityContext(Context innerContext) 
    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 to wrap.
 public VelocityContext(Map context,
    Context innerContext) 
    Initializes internal storage (never to null), and inner context.
    Parameters:
    context - Internal storage, or null to create default storage.
    innerContext - Inner context.
Method from org.apache.velocity.VelocityContext Summary:
clone,   internalContainsKey,   internalGet,   internalGetKeys,   internalPut,   internalRemove
Methods from org.apache.velocity.context.AbstractContext:
containsKey,   get,   getChainedContext,   getKeys,   internalContainsKey,   internalGet,   internalGetKeys,   internalPut,   internalRemove,   put,   remove
Methods from org.apache.velocity.context.InternalContextBase:
attachEventCartridge,   getAllowRendering,   getCurrentResource,   getCurrentTemplateName,   getEventCartridge,   getTemplateNameStack,   icacheGet,   icachePut,   popCurrentTemplateName,   pushCurrentTemplateName,   setAllowRendering,   setCurrentResource
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.velocity.VelocityContext Detail:
 public Object clone() 
    Clones this context object.
 public boolean internalContainsKey(Object key) 
    determines if there is a value for the given key
 public Object internalGet(String key) 
    retrieves value for key from internal storage
 public Object[] internalGetKeys() 
    returns array of keys
 public Object internalPut(String key,
    Object value) 
    stores the value for key to internal storage
 public Object internalRemove(Object key) 
    remove a key/value pair from the internal storage