public class VelocityContext extends AbstractContext implements java.lang.Cloneable
Context| 构造器和说明 |
|---|
VelocityContext()
Creates a new instance (with no inner context).
|
VelocityContext(Context innerContext)
Chaining constructor, used when you want to
wrap a context in another.
|
VelocityContext(java.util.Map context)
Creates a new instance with the provided storage (and no inner
context).
|
VelocityContext(java.util.Map context,
Context innerContext)
Initializes internal storage (never to
null), and
inner context. |
| 限定符和类型 | 方法和说明 |
|---|---|
EventCartridge |
attachEventCartridge(EventCartridge ec) |
java.lang.Object |
clone()
Clones this context object.
|
java.util.Map |
getContext() |
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 |
getMacroLibraries()
Get the macro library list for the current template.
|
java.lang.Object[] |
getMacroNameStack()
get the current macro name stack
|
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
|
boolean |
internalContainsKey(java.lang.Object key)
determines if there is a value for the
given key
|
java.lang.Object |
internalGet(java.lang.String key)
retrieves value for key from internal
storage
|
java.lang.Object[] |
internalGetKeys()
returns array of keys
|
java.lang.Object |
internalPut(java.lang.String key,
java.lang.Object value)
stores the value for key to internal
storage
|
java.lang.Object |
internalRemove(java.lang.Object key)
remove a key/value pair from the
internal storage
|
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 macroLibraries)
Set the macro library list for the current template.
|
containsKey, get, getChainedContext, getKeys, put, removepublic VelocityContext()
public VelocityContext(java.util.Map context)
context - public VelocityContext(Context innerContext)
innerContext - The Context implementation to
wrap.public VelocityContext(java.util.Map context,
Context innerContext)
null), and
inner context.context - Internal storage, or null to
create default storage.innerContext - Inner context.public java.lang.Object internalGet(java.lang.String key)
internalGet 在类中 AbstractContextkey - name of value to getpublic java.lang.Object internalPut(java.lang.String key,
java.lang.Object value)
internalPut 在类中 AbstractContextkey - name of value to storevalue - value to storepublic boolean internalContainsKey(java.lang.Object key)
internalContainsKey 在类中 AbstractContextkey - name of value to checkpublic java.lang.Object[] internalGetKeys()
internalGetKeys 在类中 AbstractContextpublic java.lang.Object internalRemove(java.lang.Object key)
internalRemove 在类中 AbstractContextkey - name of value to removepublic java.lang.Object clone()
clone 在类中 java.lang.ObjectContext.public java.util.Map getContext()
public void pushCurrentTemplateName(java.lang.String s)
s - current template namepublic void popCurrentTemplateName()
public java.lang.String getCurrentTemplateName()
public java.lang.Object[] getTemplateNameStack()
public void pushCurrentMacroName(java.lang.String s)
s - current macro namepublic void popCurrentMacroName()
public java.lang.String getCurrentMacroName()
public int getCurrentMacroCallDepth()
public java.lang.Object[] getMacroNameStack()
public IntrospectionCacheData icacheGet(java.lang.Object key)
key - key to find in cachepublic void icachePut(java.lang.Object key,
IntrospectionCacheData o)
key - keyo - IntrospectionCacheData object to place in cachepublic void setCurrentResource(Resource r)
InternalHousekeepingContext.setCurrentResource(bboss.org.apache.velocity.runtime.resource.Resource)public Resource getCurrentResource()
InternalHousekeepingContext.getCurrentResource()public void setMacroLibraries(java.util.List macroLibraries)
macroLibraries - list of macro libraries to setInternalHousekeepingContext.setMacroLibraries(List)public java.util.List getMacroLibraries()
InternalHousekeepingContext.getMacroLibraries()public EventCartridge attachEventCartridge(EventCartridge ec)
attachEventCartridge 在接口中 InternalEventContextInternalEventContext.attachEventCartridge(bboss.org.apache.velocity.app.event.EventCartridge)public EventCartridge getEventCartridge()
getEventCartridge 在接口中 InternalEventContextInternalEventContext.getEventCartridge()