class InternalContextBase extends java.lang.Object implements InternalHousekeepingContext, InternalEventContext
Modifier and Type | Field and Description |
---|---|
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.Map<java.lang.Object,IntrospectionCacheData> |
introspectionCache
cache for node/context specific introspection information
|
private java.util.List<Template> |
macroLibraries
List for holding the macro libraries.
|
private java.util.Stack<java.lang.String> |
macroNameStack
Velocimacro name stack.
|
private static long |
serialVersionUID
Version Id for serializable
|
private java.util.Stack<java.lang.String> |
templateNameStack
Template name stack.
|
Constructor and Description |
---|
InternalContextBase() |
Modifier and Type | Method and Description |
---|---|
EventCartridge |
attachEventCartridge(EventCartridge ec) |
int |
getCurrentMacroCallDepth()
get the current macro call depth
|
java.lang.String |
getCurrentMacroName()
get the current macro name
|
Resource |
getCurrentResource()
temporary fix to enable #include() to figure out
current encoding.
|
java.lang.String |
getCurrentTemplateName()
get the current template name
|
EventCartridge |
getEventCartridge() |
java.util.List<Template> |
getMacroLibraries()
Get the macro library list for the current template.
|
java.lang.String[] |
getMacroNameStack()
get the current macro name stack
|
java.lang.String[] |
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 |
popCurrentMacroName()
remove the current macro name from stack
|
void |
popCurrentTemplateName()
remove the current template name from stack
|
void |
pushCurrentMacroName(java.lang.String s)
set the current macro name on top of stack
|
void |
pushCurrentTemplateName(java.lang.String s)
set the current template name on top of stack
|
void |
setCurrentResource(Resource r) |
void |
setMacroLibraries(java.util.List<Template> macroLibraries)
Set the macro library list for the current template.
|
private static final long serialVersionUID
private java.util.Map<java.lang.Object,IntrospectionCacheData> introspectionCache
private java.util.Stack<java.lang.String> templateNameStack
private java.util.Stack<java.lang.String> macroNameStack
private EventCartridge eventCartridge
private Resource currentResource
private java.util.List<Template> macroLibraries
public void pushCurrentTemplateName(java.lang.String s)
pushCurrentTemplateName
in interface InternalHousekeepingContext
s
- current template namepublic void popCurrentTemplateName()
popCurrentTemplateName
in interface InternalHousekeepingContext
public java.lang.String getCurrentTemplateName()
getCurrentTemplateName
in interface InternalHousekeepingContext
public java.lang.String[] getTemplateNameStack()
getTemplateNameStack
in interface InternalHousekeepingContext
public void pushCurrentMacroName(java.lang.String s)
pushCurrentMacroName
in interface InternalHousekeepingContext
s
- current macro namepublic void popCurrentMacroName()
popCurrentMacroName
in interface InternalHousekeepingContext
public java.lang.String getCurrentMacroName()
getCurrentMacroName
in interface InternalHousekeepingContext
public int getCurrentMacroCallDepth()
getCurrentMacroCallDepth
in interface InternalHousekeepingContext
public java.lang.String[] getMacroNameStack()
getMacroNameStack
in interface InternalHousekeepingContext
public IntrospectionCacheData icacheGet(java.lang.Object key)
icacheGet
in interface InternalHousekeepingContext
key
- key to find in cachepublic void icachePut(java.lang.Object key, IntrospectionCacheData o)
icachePut
in interface InternalHousekeepingContext
key
- keyo
- IntrospectionCacheData object to place in cachepublic void setCurrentResource(Resource r)
setCurrentResource
in interface InternalHousekeepingContext
InternalHousekeepingContext.setCurrentResource(org.apache.velocity.runtime.resource.Resource)
public Resource getCurrentResource()
InternalHousekeepingContext
getCurrentResource
in interface InternalHousekeepingContext
InternalHousekeepingContext.getCurrentResource()
public void setMacroLibraries(java.util.List<Template> macroLibraries)
InternalHousekeepingContext
setMacroLibraries
in interface InternalHousekeepingContext
macroLibraries
- list of macro libraries to setInternalHousekeepingContext.setMacroLibraries(List)
public java.util.List<Template> getMacroLibraries()
InternalHousekeepingContext
getMacroLibraries
in interface InternalHousekeepingContext
InternalHousekeepingContext.getMacroLibraries()
public EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge
in interface InternalEventContext
InternalEventContext.attachEventCartridge(org.apache.velocity.app.event.EventCartridge)
public EventCartridge getEventCartridge()
getEventCartridge
in interface InternalEventContext
InternalEventContext.getEventCartridge()