org.sourceforge.espro.model
Class ItemData

java.lang.Object
  extended by org.sourceforge.espro.model.AbstractModel
      extended by org.sourceforge.espro.model.ItemData
All Implemented Interfaces:
java.io.Serializable, ModelInterface

public class ItemData
extends AbstractModel

This represents Data for one Item, for one elicitation.

Author:
(c) 2007 Martin Kaffanke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.sourceforge.espro.model.AbstractModel
pcs
 
Constructor Summary
ItemData()
          Creates a new instance of ItemData
ItemData(Item i)
          Creates a new ItemData object with the given Item.
 
Method Summary
 void dataFromItem(Item i)
          Reads the given Item and loads the data from it.
 java.lang.Object get(java.lang.String key)
          Returns a data object from the given key.
 java.util.HashMap<java.lang.String,java.lang.Object> getData()
          Returns the Data
 java.lang.reflect.Method getGetter(java.lang.reflect.Field f, ElicitationMethod method)
          Returns the getter for the field.
 void setData(java.util.HashMap<java.lang.String,java.lang.Object> data)
          Sets the data
 
Methods inherited from class org.sourceforge.espro.model.AbstractModel
addPropertyChangeListener, addPropertyChangeListener, isSaved, removePropertyChangeListener, setSaved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemData

public ItemData()
Creates a new instance of ItemData


ItemData

public ItemData(Item i)
Creates a new ItemData object with the given Item.

Parameters:
i - The Item.
Method Detail

dataFromItem

public void dataFromItem(Item i)
Reads the given Item and loads the data from it.

Parameters:
i - The Item

get

public java.lang.Object get(java.lang.String key)
Returns a data object from the given key.

Parameters:
key - The key.
Returns:
The data object.

getData

public java.util.HashMap<java.lang.String,java.lang.Object> getData()
Returns the Data

Returns:
The Data

getGetter

public java.lang.reflect.Method getGetter(java.lang.reflect.Field f,
                                          ElicitationMethod method)
Returns the getter for the field.

Parameters:
f - The field.
method - The ElicitationMethod.
Returns:
The getter method.

setData

public void setData(java.util.HashMap<java.lang.String,java.lang.Object> data)
Sets the data

Parameters:
data - The data