ccc.plugins.scripting
Class Context

java.lang.Object
  extended by ccc.plugins.scripting.Context

public class Context
extends java.lang.Object

The context in which a response will be rendered to text.

Author:
Civic Computing Ltd.

Constructor Summary
Context()
           
 
Method Summary
 Context add(java.lang.String key, java.lang.Object value)
          Add an additional value to the context.
<T> T
get(java.lang.String key, java.lang.Class<T> type)
          Look up a value from the context.
 java.util.Map<java.lang.String,java.lang.Object> getAll()
          Accessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context()
Method Detail

getAll

public final java.util.Map<java.lang.String,java.lang.Object> getAll()
Accessor.

Returns:
Returns all context entries.

add

public Context add(java.lang.String key,
                   java.lang.Object value)
Add an additional value to the context.

Parameters:
key - The key used to look up the value.
value - The value to store.
Returns:
Returns a reference to 'this' context.

get

public <T> T get(java.lang.String key,
                 java.lang.Class<T> type)
Look up a value from the context.

Type Parameters:
T - The type of the object in the repository.
Parameters:
key - The key used to look up the value.
type - The type of the value.
Returns:
The value for the specified key, or NULL if no value exists.


Copyright © 2010. All Rights Reserved.