org.apache.jetspeed.portal.portlets
Class GenericMVCContext

java.lang.Object
  extended byorg.apache.jetspeed.portal.portlets.GenericMVCContext
All Implemented Interfaces:
org.apache.velocity.context.Context

public class GenericMVCContext
extends java.lang.Object
implements org.apache.velocity.context.Context

Context that holds all the data you want to transfer to your view. You populate this during your action handling.

This context also supports chaining of additional contexts. The initial context created by this object always has priority over an addtional chained objects. In short matching keys within the initial context will "hide" matching keys within the addtional context(s).

Version:
$Id: GenericMVCContext.java,v 1.3 2003/02/05 00:32:13 tkuebler Exp $
Author:
tkuebler, Scott Weaver

Constructor Summary
GenericMVCContext()
          Creates a new instance of GenericMVCContext
GenericMVCContext(java.util.Collection contexts)
          Adds an existing Collection of contexts into this one.
GenericMVCContext(org.apache.velocity.context.Context context)
          Adds an existing context into this one.
 
Method Summary
 void addContext(org.apache.velocity.context.Context context)
          Add an additional context to this one
 boolean containsKey(java.lang.Object key)
           
 java.lang.Object get(java.lang.String key)
           
 java.util.Collection getChainedContexts()
          This Collection is "live" as it is the same Collection that maintains this Context's chained contexts.
 java.lang.Object[] getKeys()
           
 java.lang.Object put(java.lang.String key, java.lang.Object value)
           
 java.lang.Object remove(java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericMVCContext

public GenericMVCContext()
Creates a new instance of GenericMVCContext


GenericMVCContext

public GenericMVCContext(java.util.Collection contexts)
Adds an existing Collection of contexts into this one. Externally added contexts are maintained indvidually and are not merged into the existing context. Done to facilitate the context chanining.


GenericMVCContext

public GenericMVCContext(org.apache.velocity.context.Context context)
Adds an existing context into this one. Externally added contexts are maintained indvidually and are not merged into the existing context Done to facilitate the context chanining.

Method Detail

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface org.apache.velocity.context.Context

get

public java.lang.Object get(java.lang.String key)
Specified by:
get in interface org.apache.velocity.context.Context

getKeys

public java.lang.Object[] getKeys()
Specified by:
getKeys in interface org.apache.velocity.context.Context

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Specified by:
put in interface org.apache.velocity.context.Context

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface org.apache.velocity.context.Context

addContext

public void addContext(org.apache.velocity.context.Context context)
Add an additional context to this one


getChainedContexts

public java.util.Collection getChainedContexts()
This Collection is "live" as it is the same Collection that maintains this Context's chained contexts. This Collection DOES NOT include objects maintained in the initial context.

Returns:
a Collection all the chained contexts


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.