|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.velocity.context.ChainedInternalContextAdapter
public abstract class ChainedInternalContextAdapter
This is an abstract internal-use-only context implementation to be used as a subclass for other internal-use-only contexts that wrap other internal-use-only contexts. We use this context to make it easier to chain an existing context as part of a new context implementation. It just delegates everything to the inner/parent context. Subclasses then only need to override the methods relevant to them.
| Field Summary | |
|---|---|
protected InternalContextAdapter |
innerContext
the parent context |
| Constructor Summary | |
|---|---|
ChainedInternalContextAdapter(InternalContextAdapter inner)
CTOR, wraps an ICA |
|
| Method Summary | |
|---|---|
EventCartridge |
attachEventCartridge(EventCartridge ec)
|
boolean |
containsKey(Object key)
Indicates whether the specified key is in the context. |
Object |
get(String key)
Retrieves from parent context. |
boolean |
getAllowRendering()
Checks to see if rendering should be allowed. |
InternalContextAdapter |
getBaseContext()
Returns the base full context impl. |
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()
|
Context |
getInternalUserContext()
Return the inner / user context. |
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()
Returns the macro name stack in form of an array. |
Object[] |
getTemplateNameStack()
Returns the template name stack in form of an array. |
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 |
Object |
localPut(String key,
Object value)
Allows callers to explicitly put objects in the local context. |
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)
Put method also stores values in parent context |
Object |
remove(Object key)
Removes the value associated with the specified key from the context. |
void |
setAllowRendering(boolean v)
Set whether rendering is allowed. |
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 |
| Field Detail |
|---|
protected InternalContextAdapter innerContext
| Constructor Detail |
|---|
public ChainedInternalContextAdapter(InternalContextAdapter inner)
inner - context| Method Detail |
|---|
public Context getInternalUserContext()
getInternalUserContext in interface InternalWrapperContextpublic InternalContextAdapter getBaseContext()
InternalWrapperContext
getBaseContext in interface InternalWrapperContextInternalWrapperContext.getBaseContext()public Object get(String key)
get in interface Contextkey - name of item to get
public Object put(String key,
Object value)
put in interface Contextkey - name of item to setvalue - object to set to key
public boolean containsKey(Object key)
Context
containsKey in interface Contextkey - The key to look for.
Context.containsKey(java.lang.Object)public Object[] getKeys()
Context
getKeys in interface ContextContext.getKeys()public Object remove(Object key)
Context
remove in interface Contextkey - The name of the value to remove.
null
if unmapped.Context.remove(java.lang.Object)public void pushCurrentTemplateName(String s)
s - current template nameInternalHousekeepingContext.pushCurrentTemplateName(java.lang.String)public void popCurrentTemplateName()
InternalHousekeepingContext.popCurrentTemplateName()public String getCurrentTemplateName()
InternalHousekeepingContext.getCurrentTemplateName()public Object[] getTemplateNameStack()
InternalHousekeepingContext.getTemplateNameStack()public void pushCurrentMacroName(String s)
s - current macro nameInternalHousekeepingContext.pushCurrentMacroName(java.lang.String)public void popCurrentMacroName()
InternalHousekeepingContext.popCurrentMacroName()public String getCurrentMacroName()
InternalHousekeepingContext.getCurrentMacroName()public int getCurrentMacroCallDepth()
InternalHousekeepingContext.getCurrentMacroCallDepth()public Object[] getMacroNameStack()
InternalHousekeepingContext.getMacroNameStack()public IntrospectionCacheData icacheGet(Object key)
key - key to find in cache
InternalHousekeepingContext.icacheGet(java.lang.Object)
public Object localPut(String key,
Object value)
InternalWrapperContext
localPut in interface InternalWrapperContextkey - name of item to set.value - object to set to key.
InternalWrapperContext.localPut(java.lang.String,java.lang.Object)
public void icachePut(Object key,
IntrospectionCacheData o)
key - keyo - IntrospectionCacheData object to place in cacheInternalHousekeepingContext.icachePut(java.lang.Object, org.apache.velocity.util.introspection.IntrospectionCacheData)public boolean getAllowRendering()
InternalHousekeepingContext.getAllowRendering()public void setAllowRendering(boolean v)
InternalHousekeepingContext.setAllowRendering(boolean)public void setMacroLibraries(List macroLibraries)
macroLibraries - list of macro libraries to setInternalHousekeepingContext.setMacroLibraries(List)public List getMacroLibraries()
InternalHousekeepingContext.getMacroLibraries()public EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge in interface InternalEventContextInternalEventContext.attachEventCartridge(org.apache.velocity.app.event.EventCartridge)public EventCartridge getEventCartridge()
getEventCartridge in interface InternalEventContextInternalEventContext.getEventCartridge()public void setCurrentResource(Resource r)
InternalHousekeepingContext.setCurrentResource(org.apache.velocity.runtime.resource.Resource)public Resource getCurrentResource()
InternalHousekeepingContext.getCurrentResource()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||