|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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 :
| Constructor Summary | |
AbstractContext()
default CTOR |
|
AbstractContext(Context inner)
Chaining constructor accepts a Context argument. |
|
| Method Summary | |
EventCartridge |
attachEventCartridge(EventCartridge ec)
|
boolean |
containsKey(Object key)
Indicates whether the specified key is in the context. |
Object |
get(String key)
Gets the value corresponding to the provided key from the context. |
Context |
getChainedContext()
returns innerContext if one is chained |
int |
getCurrentMacroCallDepth()
get the current macro call depth |
String |
getCurrentMacroName()
get the current macro name |
Resource |
getCurrentResource()
temporary fix to enable #include() to figure out current encoding. |
String |
getCurrentTemplateName()
get the current template name |
EventCartridge |
getEventCartridge()
|
Object[] |
getKeys()
Get all the keys for the values in the context |
List |
getMacroLibraries()
Get the macro library list for the current template. |
Object[] |
getMacroNameStack()
get the current macro name stack |
Object[] |
getTemplateNameStack()
get the current template name stack |
IntrospectionCacheData |
icacheGet(Object key)
returns an IntrospectionCache Data (@see IntrospectionCacheData) object if exists for the key |
void |
icachePut(Object key,
IntrospectionCacheData o)
places an IntrospectionCache Data (@see IntrospectionCacheData) element in the cache for specified key |
abstract boolean |
internalContainsKey(Object key)
Implement to determine if a key is in the storage. |
abstract Object |
internalGet(String key)
Implement to return a value from the context storage. |
abstract Object[] |
internalGetKeys()
Implement to return an object array of key strings from your storage. |
abstract Object |
internalPut(String key,
Object value)
Implement to put a value into the context storage. |
abstract Object |
internalRemove(Object key)
I mplement to remove an item from your storage. |
void |
popCurrentMacroName()
remove the current macro name from stack |
void |
popCurrentTemplateName()
remove the current template name from stack |
void |
pushCurrentMacroName(String s)
set the current macro name on top of stack |
void |
pushCurrentTemplateName(String s)
set the current template name on top of stack |
Object |
put(String key,
Object value)
Adds a name/value pair to the context. |
Object |
remove(Object key)
Removes the value associated with the specified key from the context. |
void |
setCurrentResource(Resource r)
|
void |
setMacroLibraries(List macroLibraries)
Set the macro library list for the current template. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractContext()
public AbstractContext(Context inner)
inner - context to be chained| Method Detail |
public abstract Object internalGet(String key)
key - key whose associated value is to be returned
public abstract Object internalPut(String key,
Object value)
key - key with which to associate the valuevalue - value to be associated with the key
public abstract boolean internalContainsKey(Object key)
key - key to test for existance
public abstract Object[] internalGetKeys()
public abstract Object internalRemove(Object key)
key - key to remove
public Object put(String key,
Object value)
put in interface Contextkey - The name to key the provided value with.value - The corresponding value.
public Object get(String key)
get in interface Contextkey - The name of the desired value.
public boolean containsKey(Object key)
containsKey in interface Contextkey - The key to look for.
public Object[] getKeys()
getKeys in interface Contextpublic Object remove(Object key)
remove in interface Contextkey - The name of the value to remove.
null
if unmapped.public Context getChainedContext()
null if notpublic void pushCurrentTemplateName(String s)
pushCurrentTemplateName in interface org.apache.velocity.context.InternalHousekeepingContexts - current template namepublic void popCurrentTemplateName()
popCurrentTemplateName in interface org.apache.velocity.context.InternalHousekeepingContextpublic String getCurrentTemplateName()
getCurrentTemplateName in interface org.apache.velocity.context.InternalHousekeepingContextpublic Object[] getTemplateNameStack()
getTemplateNameStack in interface org.apache.velocity.context.InternalHousekeepingContextpublic void pushCurrentMacroName(String s)
pushCurrentMacroName in interface org.apache.velocity.context.InternalHousekeepingContexts - current macro namepublic void popCurrentMacroName()
popCurrentMacroName in interface org.apache.velocity.context.InternalHousekeepingContextpublic String getCurrentMacroName()
getCurrentMacroName in interface org.apache.velocity.context.InternalHousekeepingContextpublic int getCurrentMacroCallDepth()
getCurrentMacroCallDepth in interface org.apache.velocity.context.InternalHousekeepingContextpublic Object[] getMacroNameStack()
getMacroNameStack in interface org.apache.velocity.context.InternalHousekeepingContextpublic IntrospectionCacheData icacheGet(Object key)
icacheGet in interface org.apache.velocity.context.InternalHousekeepingContextkey - key to find in cache
public void icachePut(Object key,
IntrospectionCacheData o)
icachePut in interface org.apache.velocity.context.InternalHousekeepingContextkey - keyo - IntrospectionCacheData object to place in cachepublic void setCurrentResource(Resource r)
setCurrentResource in interface org.apache.velocity.context.InternalHousekeepingContextr - InternalHousekeepingContext.setCurrentResource(org.apache.velocity.runtime.resource.Resource)public Resource getCurrentResource()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentResource in interface org.apache.velocity.context.InternalHousekeepingContextInternalHousekeepingContext.getCurrentResource()public void setMacroLibraries(List macroLibraries)
org.apache.velocity.context.InternalHousekeepingContext
setMacroLibraries in interface org.apache.velocity.context.InternalHousekeepingContextmacroLibraries - list of macro libraries to setInternalHousekeepingContext.setMacroLibraries(List)public List getMacroLibraries()
org.apache.velocity.context.InternalHousekeepingContext
getMacroLibraries in interface org.apache.velocity.context.InternalHousekeepingContextInternalHousekeepingContext.getMacroLibraries()public EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge in interface InternalEventContextec -
InternalEventContext.attachEventCartridge(org.apache.velocity.app.event.EventCartridge)public EventCartridge getEventCartridge()
getEventCartridge in interface InternalEventContextInternalEventContext.getEventCartridge()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||