public interface VelocityContext
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(java.lang.Object key)
Indicates whether a named object exists in this context for a given key.
|
java.lang.Object |
get(java.lang.String key)
Gets the named object associated with a given key.
|
java.lang.Object[] |
getKeys()
Obtains an array of all keys for this context.
|
boolean |
isPermitOverrides()
Indicates whether a call to
put will update this context
if a value already exists in the context by the specified key. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Adds a named object to this context.
|
java.lang.Object |
remove(java.lang.Object key)
Removes the value associated with the specified key from the context.
|
boolean isPermitOverrides()
put
will update this context
if a value already exists in the context by the specified key.java.lang.Object put(java.lang.String key, java.lang.Object value)
key
- The key with which to store the object in context.
Keys prefixed with a '_' are reserved for internal use.
Attempting to set a named object using a key prefixed with
'_' will throw a runtime exception. Likewise attempting to
put a named object in this context with a previously used
key in which overrides are not permitted with throw a
runtime exception.value
- The context value.java.lang.Object get(java.lang.String key)
key
- associated with the named object.null
if no object exists for the given key.boolean containsKey(java.lang.Object key)
key
- to use for checking whether an associated object exists in
this context.java.lang.Object[] getKeys()
java.lang.Object remove(java.lang.Object key)
key
- The name of the value to remove.null
the key
was not previously associated with any named object in this
context.