Package org.apache.velocity.example
Class TreeMapContext
java.lang.Object
org.apache.velocity.context.InternalContextBase
org.apache.velocity.context.AbstractContext
org.apache.velocity.example.TreeMapContext
- All Implemented Interfaces:
Context,InternalEventContext,InternalHousekeepingContext
Example context impl that uses a TreeMap
Not much point other than to show how easy it is.
This is unsupported, example code.
- Version:
- $Id$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanImplement to determine if a key is in the storage.internalGet(String key) Implement to return a value from the context storage.String[]Implement to return an object array of key strings from your storage.internalPut(String key, Object value) Implement to put a value into the context storage.internalRemove(String key) Implement to remove an item from your storage.Methods inherited from class org.apache.velocity.context.AbstractContext
containsKey, get, getChainedContext, getKeys, put, removeMethods inherited from class org.apache.velocity.context.InternalContextBase
attachEventCartridge, getCurrentMacroCallDepth, getCurrentMacroName, getCurrentResource, getCurrentTemplateName, getEventCartridge, getMacroLibraries, getMacroNameStack, getTemplateNameStack, icacheGet, icachePut, popCurrentMacroName, popCurrentTemplateName, pushCurrentMacroName, pushCurrentTemplateName, setCurrentResource, setMacroLibraries
-
Field Details
-
context
-
-
Constructor Details
-
TreeMapContext
public TreeMapContext() -
TreeMapContext
-
-
Method Details
-
internalGet
Description copied from class:AbstractContextImplement to return a value from the context storage.
The implementation of this method is required for proper operation of a Context implementation in general Velocity use.- Specified by:
internalGetin classAbstractContext- Parameters:
key- key whose associated value is to be returned- Returns:
- object stored in the context
-
internalPut
Description copied from class:AbstractContextImplement to put a value into the context storage.
The implementation of this method is required for proper operation of a Context implementation in general Velocity use.- Specified by:
internalPutin classAbstractContext- Parameters:
key- key with which to associate the valuevalue- value to be associated with the key- Returns:
- previously stored value if exists, or null
-
internalContainsKey
Description copied from class:AbstractContextImplement to determine if a key is in the storage.
Currently, this method is not used internally by the Velocity engine.- Specified by:
internalContainsKeyin classAbstractContext- Parameters:
key- key to test for existence- Returns:
- true if found, false if not
-
internalGetKeys
Description copied from class:AbstractContextImplement to return an object array of key strings from your storage.
Currently, this method is not used internally by the Velocity engine.- Specified by:
internalGetKeysin classAbstractContext- Returns:
- array of keys
-
internalRemove
Description copied from class:AbstractContextImplement to remove an item from your storage.
Currently, this method is not used internally by the Velocity engine.- Specified by:
internalRemovein classAbstractContext- Parameters:
key- key to remove- Returns:
- object removed if exists, else null
-