|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.velocity.context.InternalContextBase
class to encapsulate the 'stuff' for internal operation of velocity. We use the context as a thread-safe storage : we take advantage of the fact that it's a visitor of sorts to all nodes (that matter) of the AST during init() and render(). Currently, it carries the template name for namespace support, as well as node-local context data introspection caching. Note that this is not a public class. It is for package access only to keep application code from accessing the internals, as AbstractContext is derived from this.
| Field Summary | |
private Resource |
currentResource
Current resource - used for carrying encoding and other information down into the rendering process |
private EventCartridge |
eventCartridge
EventCartridge we are to carry. |
private java.util.HashMap |
introspectionCache
cache for node/context specific introspection information |
private java.util.Stack |
templateNameStack
Template name stack. |
| Constructor Summary | |
(package private) |
InternalContextBase()
|
| Method Summary | |
EventCartridge |
attachEventCartridge(EventCartridge ec)
|
Resource |
getCurrentResource()
temporary fix to enable #include() to figure out current encoding. |
java.lang.String |
getCurrentTemplateName()
get the current template name |
EventCartridge |
getEventCartridge()
|
java.lang.Object[] |
getTemplateNameStack()
get the current template name stack |
IntrospectionCacheData |
icacheGet(java.lang.Object key)
returns an IntrospectionCache Data (@see IntrospectionCacheData) object if exists for the key |
void |
icachePut(java.lang.Object key,
IntrospectionCacheData o)
places an IntrospectionCache Data (@see IntrospectionCacheData) element in the cache for specified key |
void |
popCurrentTemplateName()
remove the current template name from stack |
void |
pushCurrentTemplateName(java.lang.String s)
set the current template name on top of stack |
void |
setCurrentResource(Resource r)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private java.util.HashMap introspectionCache
private java.util.Stack templateNameStack
private EventCartridge eventCartridge
private Resource currentResource
| Constructor Detail |
InternalContextBase()
| Method Detail |
public void pushCurrentTemplateName(java.lang.String s)
pushCurrentTemplateName in interface InternalHousekeepingContexts - current template namepublic void popCurrentTemplateName()
popCurrentTemplateName in interface InternalHousekeepingContextpublic java.lang.String getCurrentTemplateName()
getCurrentTemplateName in interface InternalHousekeepingContextpublic java.lang.Object[] getTemplateNameStack()
getTemplateNameStack in interface InternalHousekeepingContextpublic IntrospectionCacheData icacheGet(java.lang.Object key)
icacheGet in interface InternalHousekeepingContextkey - key to find in cache
public void icachePut(java.lang.Object key,
IntrospectionCacheData o)
icachePut in interface InternalHousekeepingContextkey - keyo - IntrospectionCacheData object to place in cachepublic void setCurrentResource(Resource r)
setCurrentResource in interface InternalHousekeepingContextpublic Resource getCurrentResource()
InternalHousekeepingContextgetCurrentResource in interface InternalHousekeepingContextpublic EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge in interface InternalEventContextpublic EventCartridge getEventCartridge()
getEventCartridge in interface InternalEventContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||