Package org.apache.velocity.context
Class ChainedInternalContextAdapter
java.lang.Object
org.apache.velocity.context.ChainedInternalContextAdapter
- All Implemented Interfaces:
Context,InternalContextAdapter,InternalEventContext,InternalWrapperContext
- Direct Known Subclasses:
EvaluateContext,Foreach.NullHolderContext,ProxyVMContext
public abstract class ChainedInternalContextAdapter
extends Object
implements InternalContextAdapter
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.
- Since:
- 1.6
- Version:
- $Id: ChainedInternalContextAdapter.java 685724 2008-08-13 23:12:12Z nbubna $
- Author:
- Nathan Bubna
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCTOR, wraps an ICA -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) Indicates whether the specified key is in the context.Retrieves from parent context.Returns the base full context impl.intReturn the inner / user context.Object[]getKeys()Get all the keys for the values in the context.Object[]Object[]voidicachePut(Object key, IntrospectionCacheData o) Allows callers to explicitly put objects in the local context.voidvoidvoidvoidPut method also stores values in parent contextRemoves the value associated with the specified key from the context.voidvoidsetMacroLibraries(List macroLibraries)
-
Field Details
-
innerContext
the parent context
-
-
Constructor Details
-
ChainedInternalContextAdapter
CTOR, wraps an ICA- Parameters:
inner- context
-
-
Method Details
-
getInternalUserContext
Return the inner / user context.- Specified by:
getInternalUserContextin interfaceInternalWrapperContext- Returns:
- The inner / user context.
-
getBaseContext
Description copied from interface:InternalWrapperContextReturns the base full context impl.- Specified by:
getBaseContextin interfaceInternalWrapperContext- Returns:
- The base full context impl.
- See Also:
-
get
Retrieves from parent context. -
put
Put method also stores values in parent context -
containsKey
Description copied from interface:ContextIndicates whether the specified key is in the context.- Specified by:
containsKeyin interfaceContext- Parameters:
key- The key to look for.- Returns:
- Whether the key is in the context.
- See Also:
-
getKeys
Description copied from interface:ContextGet all the keys for the values in the context. -
remove
Description copied from interface:ContextRemoves the value associated with the specified key from the context. -
pushCurrentTemplateName
- See Also:
-
InternalHousekeepingContext.pushCurrentTemplateName(java.lang.String)
-
popCurrentTemplateName
public void popCurrentTemplateName()- See Also:
-
InternalHousekeepingContext.popCurrentTemplateName()
-
getCurrentTemplateName
- See Also:
-
InternalHousekeepingContext.getCurrentTemplateName()
-
getTemplateNameStack
- See Also:
-
InternalHousekeepingContext.getTemplateNameStack()
-
pushCurrentMacroName
- See Also:
-
InternalHousekeepingContext.pushCurrentMacroName(java.lang.String)
-
popCurrentMacroName
public void popCurrentMacroName()- See Also:
-
InternalHousekeepingContext.popCurrentMacroName()
-
getCurrentMacroName
- See Also:
-
InternalHousekeepingContext.getCurrentMacroName()
-
getCurrentMacroCallDepth
public int getCurrentMacroCallDepth()- See Also:
-
InternalHousekeepingContext.getCurrentMacroCallDepth()
-
getMacroNameStack
- See Also:
-
InternalHousekeepingContext.getMacroNameStack()
-
icacheGet
- See Also:
-
InternalHousekeepingContext.icacheGet(java.lang.Object)
-
localPut
Description copied from interface:InternalWrapperContextAllows callers to explicitly put objects in the local context. Objects added to the context through this method always end up in the top-level context of possible wrapped contexts.- Specified by:
localPutin interfaceInternalWrapperContext- Parameters:
key- name of item to set.value- object to set to key.- Returns:
- old stored object
- See Also:
-
icachePut
- See Also:
-
InternalHousekeepingContext.icachePut(java.lang.Object, org.apache.velocity.util.introspection.IntrospectionCacheData)
-
setMacroLibraries
- See Also:
-
InternalHousekeepingContext.setMacroLibraries(List)
-
getMacroLibraries
- See Also:
-
InternalHousekeepingContext.getMacroLibraries()
-
attachEventCartridge
- Specified by:
attachEventCartridgein interfaceInternalEventContext- Returns:
- The old EventCartridge.
- See Also:
-
getEventCartridge
- Specified by:
getEventCartridgein interfaceInternalEventContext- Returns:
- The current EventCartridge.
- See Also:
-
setCurrentResource
- See Also:
-
InternalHousekeepingContext.setCurrentResource(org.apache.velocity.runtime.resource.Resource)
-
getCurrentResource
- See Also:
-
InternalHousekeepingContext.getCurrentResource()
-