Package org.apache.velocity.context
Class InternalContextAdapterImpl
java.lang.Object
org.apache.velocity.context.InternalContextAdapterImpl
- All Implemented Interfaces:
- Context,- InternalContextAdapter,- InternalEventContext,- InternalWrapperContext
This adapter class is the container for all context types for internal
  use.  The AST now uses this class rather than the app-level Context
  interface to allow flexibility in the future.
  Currently, we have two context interfaces which must be supported :
  
- Context : used for application/template data access
- InternalHousekeepingContext : used for internal housekeeping and caching
- InternalWrapperContext : used for getting root cache context and other such.
- InternalEventContext : for event handling.
- Version:
- $Id$
- Author:
- Geir Magnusson Jr.
- 
Constructor SummaryConstructorsConstructorDescriptionCTOR takes a Context and wraps it, delegating all 'data' calls to it.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsKey(String key) Indicates whether the specified key is in the context.Gets the value corresponding to the provided key from the context.Returns the base context that we are wrapping.intreturns the user data context that we are wrappingString[]getKeys()Get all the keys for the values in the context.String[]String[]voidicachePut(Object key, IntrospectionCacheData o) voidvoidvoidvoidAdds a name/value pair to the context.Removes the value associated with the specified key from the context.voidvoidsetMacroLibraries(List<Template> macroLibraries) 
- 
Constructor Details- 
InternalContextAdapterImplCTOR takes a Context and wraps it, delegating all 'data' calls to it. For support of internal contexts, it will create an InternalContextBase if need be.- Parameters:
- c-
 
 
- 
- 
Method Details- 
pushCurrentTemplateName- See Also:
 
- 
popCurrentTemplateNamepublic void popCurrentTemplateName()- See Also:
 
- 
getCurrentTemplateName- See Also:
 
- 
getTemplateNameStack- See Also:
 
- 
pushCurrentMacroName- Since:
- 1.6
- See Also:
 
- 
popCurrentMacroNamepublic void popCurrentMacroName()- Since:
- 1.6
- See Also:
 
- 
getCurrentMacroName- Since:
- 1.6
- See Also:
 
- 
getCurrentMacroCallDepthpublic int getCurrentMacroCallDepth()- Since:
- 1.6
- See Also:
 
- 
getMacroNameStack- Since:
- 1.6
- See Also:
 
- 
icacheGet- See Also:
 
- 
icachePut- See Also:
 
- 
setCurrentResource- See Also:
 
- 
getCurrentResource- See Also:
 
- 
setMacroLibraries- Since:
- 1.6
- See Also:
 
- 
getMacroLibraries- Since:
- 1.6
- See Also:
 
- 
putDescription copied from interface:ContextAdds a name/value pair to the context.- Specified by:
- putin interface- Context
- Specified by:
- putin interface- InternalWrapperContext
- Parameters:
- key- The name to key the provided value with.
- value- The corresponding value.
- Returns:
- The old object or null if there was no old object.
- See Also:
 
- 
getDescription copied from interface:ContextGets the value corresponding to the provided key from the context.- Specified by:
- getin interface- Context
- Specified by:
- getin interface- InternalWrapperContext
- Parameters:
- key- The name of the desired value.
- Returns:
- The value corresponding to the provided key.
- See Also:
 
- 
containsKeyDescription copied from interface:ContextIndicates whether the specified key is in the context.- Specified by:
- containsKeyin interface- Context
- Specified by:
- containsKeyin interface- InternalWrapperContext
- Parameters:
- key- The key to look for.
- Returns:
- Whether the key is in the context.
- See Also:
 
- 
getKeysDescription copied from interface:ContextGet all the keys for the values in the context.
- 
removeDescription copied from interface:ContextRemoves the value associated with the specified key from the context.
- 
getInternalUserContextreturns the user data context that we are wrapping- Specified by:
- getInternalUserContextin interface- InternalWrapperContext
- Returns:
- The internal user data context.
 
- 
getBaseContextReturns the base context that we are wrapping. Here, its this, but for other thing like VM related context contortions, it can be something else- Specified by:
- getBaseContextin interface- InternalWrapperContext
- Returns:
- The base context.
 
- 
attachEventCartridge- Specified by:
- attachEventCartridgein interface- InternalEventContext
- Parameters:
- ec-
- Returns:
- The old EventCartridge.
- See Also:
 
- 
getEventCartridge- Specified by:
- getEventCartridgein interface- InternalEventContext
- Returns:
- The current EventCartridge.
- See Also:
 
 
-