Class SessionData
- java.lang.Object
-
- org.apache.turbine.services.pull.util.SessionData
-
- All Implemented Interfaces:
ApplicationTool
public class SessionData extends Object implements ApplicationTool
Pull tool designed to be used in the session scope for storage of temporary data. This tool should eliminate the need for theUser.setTemp(java.lang.String, java.lang.Object)
andUser.getTemp(java.lang.String)
methods.- Version:
- $Id$
- Author:
- Quinton McCombs
-
-
Constructor Summary
Constructors Constructor Description SessionData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all databoolean
containsKey(String key)
Determines is a given key is stored.Object
get(String key)
Gets the data stored under the key.void
init(Object data)
Initialize the application tool.Iterator<String>
iterator()
Gets a iterator for the keys.void
put(String key, Object value)
Stores the data.void
refresh()
Refresh the application tool.
-
-
-
Constructor Detail
-
SessionData
public SessionData()
-
-
Method Detail
-
init
public void init(Object data)
Initialize the application tool.- Specified by:
init
in interfaceApplicationTool
- Parameters:
data
- initialization data
-
refresh
public void refresh()
Refresh the application tool.- Specified by:
refresh
in interfaceApplicationTool
-
get
public Object get(String key)
Gets the data stored under the key. Null will be returned if the key does not exist or if null was stored under the key.To check for a key with a null value use
containsKey(java.lang.String)
.- Parameters:
key
- key under which the data is stored.- Returns:
Object
stored under the key.
-
containsKey
public boolean containsKey(String key)
Determines is a given key is stored.- Parameters:
key
- the key to check for- Returns:
- true if the key was found
-
put
public void put(String key, Object value)
Stores the data. If the key already exists, the value will be overwritten.- Parameters:
key
- key under which the data will be stored.value
- data to store under the key. Null values are allowed.
-
clear
public void clear()
Clears all data
-
-