org.apache.velocity.context
Interface Context
- InternalContextAdapter
- AbstractContext, InternalContextAdapterImpl, VelocityContext, VMContext
Interface describing the application data context. This set of
routines is used by the application to set and remove 'named' data
object to pass them to the template engine to use when rendering
a template.
This is the same set of methods supported by the original Context
class
Version:
- Jason van Zyl
- Geir Magnusson Jr.
AbstractContext
, VelocityContext
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.
|
Object[] | getKeys() - Get all the keys for the values in the context
|
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.
|
containsKey
public boolean containsKey(Object key)
Indicates whether the specified key is in the context.
key
- The key to look for.
- Whether the key is in the context.
get
public Object get(String key)
Gets the value corresponding to the provided key from the context.
key
- The name of the desired value.
- The value corresponding to the provided key.
getKeys
public Object[] getKeys()
Get all the keys for the values in the context
put
public Object put(String key,
Object value)
Adds a name/value pair to the context.
key
- The name to key the provided value with.value
- The corresponding value.
remove
public Object remove(Object key)
Removes the value associated with the specified key from the context.
key
- The name of the value to remove.
- The value that the key was mapped to, or
null
if unmapped.
Copyright © 2003 Apache Software Foundation. All Rights Reserved.