|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.context.VMContext
This is a special, internal-use-only context implementation to be used for the new Velocimacro implementation. The main distinguishing feature is the management of the VMProxyArg objects in the put() and get() methods. Further, this context also supports the 'VM local context' mode, where any put() of references that aren't args to the VM are considered local to the vm, protecting the global context.
Constructor Summary | |
VMContext(InternalContextAdapter inner,
RuntimeServices rsvc)
CTOR, wraps an ICA |
Method Summary | |
void |
addVMProxyArg(VMProxyArg vmpa)
Used to put VMProxyArgs into this context. |
EventCartridge |
attachEventCartridge(EventCartridge ec)
|
boolean |
containsKey(Object key)
Indicates whether the specified key is in the context. |
Object |
get(String key)
Impl of the Context.gut() method. |
boolean |
getAllowRendering()
Checks to see if rendering should be allowed. |
InternalContextAdapter |
getBaseContext()
Returns the base full context impl. |
Resource |
getCurrentResource()
temporary fix to enable #include() to figure out current encoding. |
String |
getCurrentTemplateName()
get the current template name |
EventCartridge |
getEventCartridge()
|
Context |
getInternalUserContext()
Return the inner / user context. |
Object[] |
getKeys()
Get all the keys for the values in the context. |
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, no matter what the velocimacro.context.local setting says. |
void |
popCurrentTemplateName()
remove the current template name from stack |
void |
pushCurrentTemplateName(String s)
set the current template name on top of stack |
Object |
put(String key,
Object value)
Impl of the Context.put() method. |
protected Object |
put(String key,
Object value,
boolean forceLocal)
Internal put method to select between local and global scope. |
Object |
remove(Object key)
Removes the value associated with the specified key from the context. |
void |
setAllowRendering(boolean v)
Set whether rendering is allowed. |
void |
setCurrentResource(Resource r)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VMContext(InternalContextAdapter inner, RuntimeServices rsvc)
inner
- rsvc
- Method Detail |
public Context getInternalUserContext()
getInternalUserContext
in interface InternalWrapperContext
public InternalContextAdapter getBaseContext()
InternalWrapperContext
getBaseContext
in interface InternalWrapperContext
InternalWrapperContext.getBaseContext()
public void addVMProxyArg(VMProxyArg vmpa) throws MethodInvocationException
vmpa
- VMProxyArg to add
MethodInvocationException
public Object put(String key, Object value)
put
in interface Context
key
- name of item to setvalue
- object to set to key
public Object localPut(String key, Object value)
localPut
in interface InternalWrapperContext
key
- name of item to set.value
- object to set to key.
protected Object put(String key, Object value, boolean forceLocal)
key
- name of item to setvalue
- object to set to keyforceLocal
- True forces the object into the local scope.
public Object get(String key)
get
in interface Context
key
- name of item to get
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 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 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 boolean getAllowRendering()
org.apache.velocity.context.InternalHousekeepingContext
getAllowRendering
in interface org.apache.velocity.context.InternalHousekeepingContext
InternalHousekeepingContext.getAllowRendering()
public void setAllowRendering(boolean v)
org.apache.velocity.context.InternalHousekeepingContext
setAllowRendering
in interface org.apache.velocity.context.InternalHousekeepingContext
v
- InternalHousekeepingContext.setAllowRendering(boolean)
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()
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()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |