|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.context.InternalContextBase | +--org.apache.velocity.context.AbstractContext
This class is the abstract base class for all conventional Velocity Context implementations. Simply extend this class and implement the abstract routines that access your preferred storage method. Takes care of context chaining. Also handles / enforces policy on null keys and values :
Field Summary | |
private Context |
innerContext
the chained Context if any |
Fields inherited from class org.apache.velocity.context.InternalContextBase |
currentResource, eventCartridge, introspectionCache, templateNameStack |
Constructor Summary | |
AbstractContext()
default CTOR |
|
AbstractContext(Context inner)
Chaining constructor accepts a Context argument. |
Method Summary | |
boolean |
containsKey(java.lang.Object key)
Indicates whether the specified key is in the context. |
java.lang.Object |
get(java.lang.String key)
Gets the value corresponding to the provided key from the context. |
Context |
getChainedContext()
returns innerContext if one is chained |
java.lang.Object[] |
getKeys()
Get all the keys for the values in the context |
abstract boolean |
internalContainsKey(java.lang.Object key)
Implement to determine if a key is in the storage. |
abstract java.lang.Object |
internalGet(java.lang.String key)
Implement to return a value from the context storage. |
abstract java.lang.Object[] |
internalGetKeys()
Implement to return an object array of key strings from your storage. |
abstract java.lang.Object |
internalPut(java.lang.String key,
java.lang.Object value)
Implement to put a value into the context storage. |
abstract java.lang.Object |
internalRemove(java.lang.Object key)
I mplement to remove an item from your storage. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Adds a name/value pair to the context. |
java.lang.Object |
remove(java.lang.Object key)
Removes the value associated with the specified key from the context. |
Methods inherited from class org.apache.velocity.context.InternalContextBase |
attachEventCartridge, getCurrentResource, getCurrentTemplateName, getEventCartridge, getTemplateNameStack, icacheGet, icachePut, popCurrentTemplateName, pushCurrentTemplateName, setCurrentResource |
Methods inherited from class java.lang.Object |
|
Field Detail |
private Context innerContext
Constructor Detail |
public AbstractContext()
public AbstractContext(Context inner)
inner
- context to be chainedMethod Detail |
public abstract java.lang.Object internalGet(java.lang.String key)
key
- key whose associated value is to be returnedpublic abstract java.lang.Object internalPut(java.lang.String key, java.lang.Object value)
key
- key with which to associate the valuevalue
- value to be associated with the keypublic abstract boolean internalContainsKey(java.lang.Object key)
key
- key to test for existancepublic abstract java.lang.Object[] internalGetKeys()
public abstract java.lang.Object internalRemove(java.lang.Object key)
key
- key to removepublic java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface Context
key
- The name to key the provided value with.value
- The corresponding value.public java.lang.Object get(java.lang.String key)
get
in interface Context
key
- The name of the desired value.public boolean containsKey(java.lang.Object key)
containsKey
in interface Context
key
- The key to look for.public java.lang.Object[] getKeys()
getKeys
in interface Context
public java.lang.Object remove(java.lang.Object key)
remove
in interface Context
key
- The name of the value to remove.null
if unmapped.public Context getChainedContext()
null
if not
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |