Package org.apache.velocity.context
Class ChainedInternalContextAdapter
java.lang.Object
org.apache.velocity.context.ChainedInternalContextAdapter
- All Implemented Interfaces:
Context
,InternalContextAdapter
,InternalEventContext
,InternalWrapperContext
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 TypeMethodDescriptionboolean
containsKey
(String key) Indicates whether the specified key is in the context.Retrieves from parent context.Returns the base full context impl.int
Return the inner / user context.String[]
getKeys()
Get all the keys for the values in the context.String[]
String[]
void
icachePut
(Object key, IntrospectionCacheData o) void
void
void
void
Put method also stores values in parent contextRemoves the value associated with the specified key from the context.void
void
setMacroLibraries
(List<Template> macroLibraries)
-
Field Details
-
wrappedContext
the parent context
-
-
Constructor Details
-
ChainedInternalContextAdapter
CTOR, wraps an ICA- Parameters:
inner
- context
-
-
Method Details
-
getInternalUserContext
Return the inner / user context.- Specified by:
getInternalUserContext
in interfaceInternalWrapperContext
- Returns:
- The inner / user context.
-
getBaseContext
Description copied from interface:InternalWrapperContext
Returns the base full context impl.- Specified by:
getBaseContext
in interfaceInternalWrapperContext
- Returns:
- The base full context impl.
- See Also:
-
get
Retrieves from parent context.- Specified by:
get
in interfaceContext
- Specified by:
get
in interfaceInternalWrapperContext
- Parameters:
key
- name of item to get- Returns:
- stored object or null
-
put
Put method also stores values in parent context- Specified by:
put
in interfaceContext
- Specified by:
put
in interfaceInternalWrapperContext
- Parameters:
key
- name of item to setvalue
- object to set to key- Returns:
- old stored object
-
containsKey
Description copied from interface:Context
Indicates whether the specified key is in the context.- Specified by:
containsKey
in interfaceContext
- Specified by:
containsKey
in interfaceInternalWrapperContext
- Parameters:
key
- The key to look for.- Returns:
- Whether the key is in the context.
- See Also:
-
getKeys
Description copied from interface:Context
Get all the keys for the values in the context. -
remove
Description copied from interface:Context
Removes the value associated with the specified key from the context. -
pushCurrentTemplateName
- See Also:
-
popCurrentTemplateName
public void popCurrentTemplateName()- See Also:
-
getCurrentTemplateName
- See Also:
-
getTemplateNameStack
- See Also:
-
pushCurrentMacroName
- See Also:
-
popCurrentMacroName
public void popCurrentMacroName()- See Also:
-
getCurrentMacroName
- See Also:
-
getCurrentMacroCallDepth
public int getCurrentMacroCallDepth()- See Also:
-
getMacroNameStack
- See Also:
-
icacheGet
- See Also:
-
icachePut
- See Also:
-
setMacroLibraries
- See Also:
-
getMacroLibraries
- See Also:
-
attachEventCartridge
- Specified by:
attachEventCartridge
in interfaceInternalEventContext
- Parameters:
ec
-- Returns:
- The old EventCartridge.
- See Also:
-
getEventCartridge
- Specified by:
getEventCartridge
in interfaceInternalEventContext
- Returns:
- The current EventCartridge.
- See Also:
-
setCurrentResource
- See Also:
-
getCurrentResource
- See Also:
-