public class VelocityContext extends AbstractContext implements java.lang.Cloneable, java.io.Serializable
Context
,
Serialized FormModifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
context
Storage for key/value pairs.
|
private static long |
serialVersionUID
Version Id for serializable
|
Constructor and Description |
---|
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<java.lang.String,java.lang.Object> context)
Creates a new instance with the provided storage (and no inner
context).
|
VelocityContext(java.util.Map<java.lang.String,java.lang.Object> context,
Context innerContext)
Initializes internal storage (never to
null ), and
inner context. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones this context object.
|
boolean |
internalContainsKey(java.lang.String 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.String[] |
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.String key)
remove a key/value pair from the
internal storage
|
containsKey, get, getChainedContext, getKeys, put, remove
attachEventCartridge, getCurrentMacroCallDepth, getCurrentMacroName, getCurrentResource, getCurrentTemplateName, getEventCartridge, getMacroLibraries, getMacroNameStack, getTemplateNameStack, icacheGet, icachePut, popCurrentMacroName, popCurrentTemplateName, pushCurrentMacroName, pushCurrentTemplateName, setCurrentResource, setMacroLibraries
private static final long serialVersionUID
private java.util.Map<java.lang.String,java.lang.Object> context
public VelocityContext()
public VelocityContext(java.util.Map<java.lang.String,java.lang.Object> context)
context
- public VelocityContext(Context innerContext)
innerContext
- The Context
implementation to
wrap.public VelocityContext(java.util.Map<java.lang.String,java.lang.Object> 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
in class AbstractContext
key
- name of value to getpublic java.lang.Object internalPut(java.lang.String key, java.lang.Object value)
internalPut
in class AbstractContext
key
- name of value to storevalue
- value to storepublic boolean internalContainsKey(java.lang.String key)
internalContainsKey
in class AbstractContext
key
- name of value to checkpublic java.lang.String[] internalGetKeys()
internalGetKeys
in class AbstractContext
public java.lang.Object internalRemove(java.lang.String key)
internalRemove
in class AbstractContext
key
- name of value to removepublic java.lang.Object clone()
clone
in class java.lang.Object
Context
.