java.lang.Object
org.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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
values
private java.util.Map values
ContextMap
public ContextMap()
ContextMap
public ContextMap(java.util.Map values)
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