org.enhydra.barracuda.plankton.data
Class ServletRequestStateMap

java.lang.Object
  extended byorg.enhydra.barracuda.plankton.data.ServletRequestStateMap
All Implemented Interfaces:
StateMap

public class ServletRequestStateMap
extends Object
implements StateMap

The implementation provides a StateMap bridge to a ServletRequest object. By this, we mean that this class allows you to treat an ServletRequest as a StateMap. Unlike the ServletRequest, this class will handle null keys, values.


Field Summary
protected  javax.servlet.ServletRequest request
           
 
Constructor Summary
ServletRequestStateMap(javax.servlet.ServletRequest irequest)
          Public constructor.
 
Method Summary
 void clearState()
          clear all state information
 javax.servlet.ServletRequest getRequest()
          get a reference to the underlying ServletRequest
 Object getState(Object key)
          get a property in this StateMap
 List getStateKeys()
          get a List of the keys for this StateMap (implementation is an ArrayList)
 Map getStateValues()
          get a copy of the underlying Map (in this case, we map all the attributes of the ServletRequest structure into a Map and return that)
 void putState(Object key, Object val)
          set a property in this StateMap
 Object removeState(Object key)
          remove a property in this StateMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

protected javax.servlet.ServletRequest request
Constructor Detail

ServletRequestStateMap

public ServletRequestStateMap(javax.servlet.ServletRequest irequest)
Public constructor.

Parameters:
irequest - the underlying servlet request structure
Method Detail

putState

public void putState(Object key,
                     Object val)
set a property in this StateMap

Specified by:
putState in interface StateMap
Parameters:
key - the key object
val - the value object

getState

public Object getState(Object key)
get a property in this StateMap

Specified by:
getState in interface StateMap
Parameters:
key - the key object
Returns:
the value for the given key

removeState

public Object removeState(Object key)
remove a property in this StateMap

Specified by:
removeState in interface StateMap
Parameters:
key - the key object
Returns:
the object which was removed

getStateKeys

public List getStateKeys()
get a List of the keys for this StateMap (implementation is an ArrayList)

Specified by:
getStateKeys in interface StateMap
Returns:
a List the keys for this StateMap

getStateValues

public Map getStateValues()
get a copy of the underlying Map (in this case, we map all the attributes of the ServletRequest structure into a Map and return that)

Specified by:
getStateValues in interface StateMap
Returns:
a copy of the underlying state Map

clearState

public void clearState()
clear all state information

Specified by:
clearState in interface StateMap

getRequest

public javax.servlet.ServletRequest getRequest()
get a reference to the underlying ServletRequest

Returns:
a reference to the underlying ServletRequest


Copyright © 2003 BarracudaMVC.org All Rights Reserved.