Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.core
Class ContextMap  view ContextMap download ContextMap.java

java.lang.Object
  extended byorg.mentawai.core.ContextMap
All Implemented Interfaces:
Context

public class ContextMap
extends java.lang.Object
implements Context

A simple Context that can be used for testing. A SessionContext and an ApplicationContext can be mocked with this class.


Field Summary
private  java.util.Map values
           
 
Constructor Summary
ContextMap()
           
ContextMap(java.util.Map values)
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Gets an attribute value associated with the given name.
 boolean hasAttribute(java.lang.String name)
          Returns true is an attribute exists with this name.
 void removeAttribute(java.lang.String name)
          Removes an attribute associated with the given name.
 void reset()
          Resets this context.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets an attribute value associated with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

private java.util.Map values
Constructor Detail

ContextMap

public ContextMap()

ContextMap

public ContextMap(java.util.Map values)
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface: Context
Gets an attribute value associated with the given name.

Specified by:
getAttribute in interface Context

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Description copied from interface: Context
Sets an attribute value associated with the given name. If the attribute already exists, overwrite it.

Specified by:
setAttribute in interface Context

removeAttribute

public void removeAttribute(java.lang.String name)
Description copied from interface: Context
Removes an attribute associated with the given name.

Specified by:
removeAttribute in interface Context

reset

public void reset()
Description copied from interface: Context
Resets this context. All values are discarded and a new context is internally created.

Specified by:
reset in interface Context

hasAttribute

public boolean hasAttribute(java.lang.String name)
Description copied from interface: Context
Returns true is an attribute exists with this name.

Specified by:
hasAttribute in interface Context