|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.toolkit.activity.RequestComponent | +--uk.org.ogsadai.client.toolkit.activity.Activity | +--uk.org.ogsadai.client.toolkit.activity.misc.DataStore
A data store to provide data for other activities. There are two ways in which it can be used:
setItems
, addItem
or addItems
methods (to force the data store to behave in the former manner); or the setInput
method (to force the data store to behave in the latter manner).
Note that data can be directly provided in the form of Object
s. These are interpreted as data items by using the return value of their toString()
method.
This activity has one optional input - data from the output of another activity - and one output - the data in the store.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
private static int |
FROM_ACTIVITY Data will come from the output of another activity |
private static int |
HARD_CODED Data is provided within this activity |
private java.util.List |
mItems Data - only if source for data is HARD_CODED |
private int |
mType Source for data - one of NONE_SPECIFIED , FROM_ACTIVITY or HARD_CODED |
private static int |
NONE_SPECIFIED No source for the data has been specified |
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
|
Fields inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
|
Constructor Summary | |
DataStore() Initialise a new data store. |
|
DataStore(ActivityOutput input) Initialise a new data store to act as a buffer of data from another activity's output. |
|
DataStore(java.util.List items) Initialise a new data store to act as a cache of data items, initially containing the given items. |
Method Summary | |
void |
addItem(java.lang.Object item) Add an item to the list of items in the data store. |
void |
addItems(java.util.List items) Add a list of items to the existing list of items in the data store. |
protected java.lang.String |
generateXML() Generates the XML representing the activity. |
ActivityOutput |
getOutput() Gets the activity's only output - the data in the store. |
void |
setInput(ActivityOutput input) Specify the output of another activity, from which the data will be obtained. |
void |
setItems(java.util.List items) Specify the list of items which constitute this data store. |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.Activity |
addInput, addOutput, addOutputs, getDataResourceID, getInputParameters, getOutputParameters, getOutputs, replaceSpecialCharacters, setDataResourceID, setInput |
Methods inherited from class uk.org.ogsadai.client.toolkit.activity.RequestComponent |
getDataService, getName, getSession, setDataService, setSession |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final int NONE_SPECIFIED
private static final int FROM_ACTIVITY
private static final int HARD_CODED
private int mType
NONE_SPECIFIED
, FROM_ACTIVITY
or HARD_CODED
private java.util.List mItems
HARD_CODED
Constructor Detail |
public DataStore()
setItems
, addItem
or addItems
methods must be used to cause the data store to behave as a cache of data items; or the setInput
method must be used to cause the data store to behave as a buffer of data from another activity.
public DataStore(java.util.List items)
items
- A list of objects that will be hard coded into the activity.java.lang.IllegalArgumentException
- If items
is null
.public DataStore(ActivityOutput input)
input
- The output from another activityjava.lang.IllegalArgumentException
- If input
is null
.Method Detail |
public void setInput(ActivityOutput input)
input
- The output from another activityjava.lang.IllegalStateException
- If some hard-coded data items have already been provided.java.lang.IllegalArgumentException
- If input
is null
.public void setItems(java.util.List items)
items
- The list of itemsjava.lang.IllegalStateException
- If the output of another activity has already been specified.java.lang.IllegalArgumentException
- If items
is null
.public void addItem(java.lang.Object item)
item
- The item to add.java.lang.IllegalStateException
- If the output of another activity has already been specified.java.lang.IllegalArgumentException
- If item
is null
.public void addItems(java.util.List items)
items
- The items to addjava.lang.IllegalStateException
- If the output of another activity has already been specified.java.lang.IllegalArgumentException
- If items
is null
.public ActivityOutput getOutput()
protected java.lang.String generateXML()
RequestComponent
generateXML
in class Activity
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |