|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.context.InternalContextAdapterImpl
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 :
Constructor Summary | |
InternalContextAdapterImpl(Context c)
CTOR takes a Context and wraps it, delegating all 'data' calls to it. |
Method Summary | |
EventCartridge |
attachEventCartridge(EventCartridge ec)
|
boolean |
containsKey(Object key)
Indicates whether the specified key is in the context. |
Object |
get(String key)
Gets the value corresponding to the provided key from the context. |
InternalContextAdapter |
getBaseContext()
Returns the base context that we are wrapping. |
int |
getCurrentMacroCallDepth()
get the current macro call depth |
String |
getCurrentMacroName()
get the current macro name |
Resource |
getCurrentResource()
temporary fix to enable #include() to figure out current encoding. |
String |
getCurrentTemplateName()
get the current template name |
EventCartridge |
getEventCartridge()
|
Context |
getInternalUserContext()
returns the user data context that we are wrapping |
Object[] |
getKeys()
Get all the keys for the values in the context. |
List |
getMacroLibraries()
Get the macro library list for the current template. |
Object[] |
getMacroNameStack()
Returns the macro name stack in form of an array. |
Object[] |
getTemplateNameStack()
Returns the template name stack in form of an array. |
IntrospectionCacheData |
icacheGet(Object key)
returns an IntrospectionCache Data (@see IntrospectionCacheData) object if exists for the key |
void |
icachePut(Object key,
IntrospectionCacheData o)
places an IntrospectionCache Data (@see IntrospectionCacheData) element in the cache for specified key |
Object |
localPut(String key,
Object value)
Allows callers to explicitly put objects in the local context. |
void |
popCurrentMacroName()
remove the current macro name from stack |
void |
popCurrentTemplateName()
remove the current template name from stack |
void |
pushCurrentMacroName(String s)
set the current macro name on top of stack |
void |
pushCurrentTemplateName(String s)
set the current template name on top of stack |
Object |
put(String key,
Object value)
Adds a name/value pair to the context. |
Object |
remove(Object key)
Removes the value associated with the specified key from the context. |
void |
setCurrentResource(Resource r)
|
void |
setMacroLibraries(List macroLibraries)
Set the macro library list for the current template. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InternalContextAdapterImpl(Context c)
c
- Method Detail |
public void pushCurrentTemplateName(String s)
org.apache.velocity.context.InternalHousekeepingContext
pushCurrentTemplateName
in interface org.apache.velocity.context.InternalHousekeepingContext
s
- current template nameInternalHousekeepingContext.pushCurrentTemplateName(java.lang.String)
public void popCurrentTemplateName()
org.apache.velocity.context.InternalHousekeepingContext
popCurrentTemplateName
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.popCurrentTemplateName()
public String getCurrentTemplateName()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentTemplateName
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getCurrentTemplateName()
public Object[] getTemplateNameStack()
org.apache.velocity.context.InternalHousekeepingContext
getTemplateNameStack
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getTemplateNameStack()
public void pushCurrentMacroName(String s)
org.apache.velocity.context.InternalHousekeepingContext
pushCurrentMacroName
in interface org.apache.velocity.context.InternalHousekeepingContext
s
- current macro nameInternalHousekeepingContext.pushCurrentMacroName(java.lang.String)
public void popCurrentMacroName()
org.apache.velocity.context.InternalHousekeepingContext
popCurrentMacroName
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.popCurrentMacroName()
public String getCurrentMacroName()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentMacroName
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getCurrentMacroName()
public int getCurrentMacroCallDepth()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentMacroCallDepth
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getCurrentMacroCallDepth()
public Object[] getMacroNameStack()
org.apache.velocity.context.InternalHousekeepingContext
getMacroNameStack
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getMacroNameStack()
public IntrospectionCacheData icacheGet(Object key)
org.apache.velocity.context.InternalHousekeepingContext
icacheGet
in interface org.apache.velocity.context.InternalHousekeepingContext
key
- key to find in cache
InternalHousekeepingContext.icacheGet(java.lang.Object)
public void icachePut(Object key, IntrospectionCacheData o)
org.apache.velocity.context.InternalHousekeepingContext
icachePut
in interface org.apache.velocity.context.InternalHousekeepingContext
key
- keyo
- IntrospectionCacheData object to place in cacheInternalHousekeepingContext.icachePut(java.lang.Object, org.apache.velocity.util.introspection.IntrospectionCacheData)
public void setCurrentResource(Resource r)
setCurrentResource
in interface org.apache.velocity.context.InternalHousekeepingContext
r
- InternalHousekeepingContext.setCurrentResource(org.apache.velocity.runtime.resource.Resource)
public Resource getCurrentResource()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentResource
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getCurrentResource()
public void setMacroLibraries(List macroLibraries)
org.apache.velocity.context.InternalHousekeepingContext
setMacroLibraries
in interface org.apache.velocity.context.InternalHousekeepingContext
macroLibraries
- list of macro libraries to setInternalHousekeepingContext.setMacroLibraries(List)
public List getMacroLibraries()
org.apache.velocity.context.InternalHousekeepingContext
getMacroLibraries
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getMacroLibraries()
public Object put(String key, Object value)
Context
put
in interface Context
key
- The name to key the provided value with.value
- The corresponding value.
Context.put(java.lang.String, java.lang.Object)
public Object localPut(String key, Object value)
InternalWrapperContext
localPut
in interface InternalWrapperContext
key
- name of item to set.value
- object to set to key.
InternalWrapperContext.localPut(String, Object)
public Object get(String key)
Context
get
in interface Context
key
- The name of the desired value.
Context.get(java.lang.String)
public boolean containsKey(Object key)
Context
containsKey
in interface Context
key
- The key to look for.
Context.containsKey(java.lang.Object)
public Object[] getKeys()
Context
getKeys
in interface Context
Context.getKeys()
public Object remove(Object key)
Context
remove
in interface Context
key
- The name of the value to remove.
null
if unmapped.Context.remove(java.lang.Object)
public Context getInternalUserContext()
getInternalUserContext
in interface InternalWrapperContext
public InternalContextAdapter getBaseContext()
getBaseContext
in interface InternalWrapperContext
public EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge
in interface InternalEventContext
ec
-
InternalEventContext.attachEventCartridge(org.apache.velocity.app.event.EventCartridge)
public EventCartridge getEventCartridge()
getEventCartridge
in interface InternalEventContext
InternalEventContext.getEventCartridge()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |