|
|||||||||||
| 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. |
boolean |
getAllowRendering()
Checks to see if rendering should be allowed. |
InternalContextAdapter |
getBaseContext()
Returns the base context that we are wrapping. |
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 |
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 |
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)
Adds a name/value pair to the context. |
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 InternalContextAdapterImpl(Context c)
| Method Detail |
public void pushCurrentTemplateName(String s)
org.apache.velocity.context.InternalHousekeepingContext
pushCurrentTemplateName in interface org.apache.velocity.context.InternalHousekeepingContexts - current template namepublic void popCurrentTemplateName()
org.apache.velocity.context.InternalHousekeepingContext
popCurrentTemplateName in interface org.apache.velocity.context.InternalHousekeepingContextpublic String getCurrentTemplateName()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentTemplateName in interface org.apache.velocity.context.InternalHousekeepingContextpublic Object[] getTemplateNameStack()
org.apache.velocity.context.InternalHousekeepingContext
getTemplateNameStack in interface org.apache.velocity.context.InternalHousekeepingContextpublic IntrospectionCacheData icacheGet(Object key)
org.apache.velocity.context.InternalHousekeepingContext
icacheGet in interface org.apache.velocity.context.InternalHousekeepingContextkey - key to find in cache
public void icachePut(Object key,
IntrospectionCacheData o)
org.apache.velocity.context.InternalHousekeepingContext
icachePut in interface org.apache.velocity.context.InternalHousekeepingContextkey - keyo - IntrospectionCacheData object to place in cachepublic void setCurrentResource(Resource r)
setCurrentResource in interface org.apache.velocity.context.InternalHousekeepingContextpublic Resource getCurrentResource()
org.apache.velocity.context.InternalHousekeepingContext
getCurrentResource in interface org.apache.velocity.context.InternalHousekeepingContextpublic boolean getAllowRendering()
org.apache.velocity.context.InternalHousekeepingContext
getAllowRendering in interface org.apache.velocity.context.InternalHousekeepingContextpublic void setAllowRendering(boolean v)
org.apache.velocity.context.InternalHousekeepingContext
setAllowRendering in interface org.apache.velocity.context.InternalHousekeepingContext
public Object put(String key,
Object value)
Context
put in interface Contextkey - The name to key the provided value with.value - The corresponding value.public Object get(String key)
Context
get in interface Contextkey - The name of the desired value.
public boolean containsKey(Object key)
Context
containsKey in interface Contextkey - The key to look for.
public Object[] getKeys()
Context
getKeys in interface Contextpublic Object remove(Object key)
Context
remove in interface Contextkey - The name of the value to remove.
null
if unmapped.public Context getInternalUserContext()
getInternalUserContext in interface InternalWrapperContextpublic InternalContextAdapter getBaseContext()
getBaseContext in interface InternalWrapperContextpublic EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge in interface InternalEventContextpublic EventCartridge getEventCartridge()
getEventCartridge in interface InternalEventContext
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||