NVelocity
Class VelocityContext

General purpose implemention of the application Context interface for general application use. This class should be used in place of the original Context class.

Constructor Summary
VelocityContext()
         Creates a new instance (with no inner context).
VelocityContext(System.Collections.Hashtable context)
         Creates a new instance with the provided storage (and no inner context).
VelocityContext(NVelocity.Context.IContext 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
VelocityContext(System.Collections.Hashtable context, NVelocity.Context.IContext innerContext)
         Initializes internal storage (never to
null
), and inner context.

Properties inherited from class NVelocity.Context.AbstractContext
ChainedContext, Keys

Properties inherited from class NVelocity.Context.InternalContextBase
CurrentResource, CurrentTemplateName, EventCartridge, TemplateNameStack

Method Summary
object Clone()
         Clones this context object.
bool InternalContainsKey(object key)
         determines if there is a value for the given key
object InternalGet(string key)
         retrieves value for key from internal storage
object[] InternalGetKeys()
         returns array of keys
object InternalPut(string key, object value_Renamed)
         stores the value for key to internal storage
object InternalRemove(object key)
         remove a key/value pair from the internal storage

Methods inherited from class NVelocity.Context.AbstractContext
ContainsKey, Get, Put, Remove

Methods inherited from class NVelocity.Context.InternalContextBase
AttachEventCartridge, ICacheGet, ICachePut, PopCurrentTemplateName, PushCurrentTemplateName

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Constructor Detail

VelocityContext

public VelocityContext()

Creates a new instance (with no inner context).


VelocityContext

public VelocityContext(System.Collections.Hashtable context)

Creates a new instance with the provided storage (and no inner context).


VelocityContext

public VelocityContext(NVelocity.Context.IContext 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.

VelocityContext

public VelocityContext(System.Collections.Hashtable context,
                       NVelocity.Context.IContext innerContext)

Initializes internal storage (never to

null
), and inner context.

Parameters:
context - Internal storage, or
null
to create default storage.
innerContext - Inner context.
Method Detail

Clone

public object Clone()

Clones this context object.

Returns:
A deep copy of this
Context
.

InternalContainsKey

public bool InternalContainsKey(object key)

determines if there is a value for the given key

Parameters:
key - name of value to check
Returns:
true if non-null value in store

InternalGet

public object InternalGet(string key)

retrieves value for key from internal storage

Parameters:
key - name of value to get
Returns:
value as object

InternalGetKeys

public object[] InternalGetKeys()

returns array of keys

Returns:
keys as []

InternalPut

public object InternalPut(string key,
                          object value_Renamed)

stores the value for key to internal storage

Parameters:
key - name of value to store
value - value to store
Returns:
previous value of key as Object

InternalRemove

public object InternalRemove(object key)

remove a key/value pair from the internal storage

Parameters:
key - name of value to remove
Returns:
value removed