net.javaprog.ui.wizard
Class DataModel

java.lang.Object
  extended by net.javaprog.ui.wizard.DataModel

public class DataModel
extends Object

Provides a data container that can be shared by steps aiming to collect data. A step can register a data source (such as a text field) with this data model enabling other steps to look up the value of that data source.

Author:
Michael Rudolf
See Also:
DataLookup

Field Summary
protected  Map data
          Maps identifier keys to DataLookup instances.
 
Constructor Summary
DataModel()
          Creates a new data model.
 
Method Summary
 Object getData(String key)
          Returns the value of a previously registered data source.
 void registerDataLookup(String key, DataLookup lookup)
          Registers the given data lookup mechanism with this model using the key as identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected final Map data
Maps identifier keys to DataLookup instances.

See Also:
registerDataLookup(String, DataLookup)
Constructor Detail

DataModel

public DataModel()
Creates a new data model.

Method Detail

getData

public Object getData(String key)
Returns the value of a previously registered data source. This method forwards exceptions thrown by DataLookup.lookupData().

See Also:
registerDataLookup(String, DataLookup)

registerDataLookup

public void registerDataLookup(String key,
                               DataLookup lookup)
Registers the given data lookup mechanism with this model using the key as identifier.

See Also:
getData(String), DataLookup