lt.monarch.data.binding
Class ObjectDataSource

java.lang.Object
  extended by lt.monarch.data.binding.DataSource
      extended by lt.monarch.data.binding.ObjectDataSource
All Implemented Interfaces:
Filterable

public class ObjectDataSource
extends DataSource
implements Filterable


Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.data.binding.DataSource
order
 
Constructor Summary
Constructor and Description
ObjectDataSource(java.util.List<?> dataList)
           
 
Method Summary
Modifier and Type Method and Description
 java.util.List<?> getDataList()
           
 java.lang.String getFilterCondition()
          Returns additional filter conditions
 java.lang.Integer getLimit()
          Returns result limit
 int getStartRecord()
          Return index of the first record.
 void setDataList(java.util.List<?> dataList)
           
 void setFilterCondition(java.lang.String condition)
          Sets additional filter conditions
 void setLimit(java.lang.Integer size)
          Sets limit for results.
 void setStartRecord(int index)
          Sets index of the first record that should be retrieved.
 void updateDataModel(DataBinding binding, DataModel model)
          Retrieves data according to DataBinding object form data source and stores it in DataModel object.
 
Methods inherited from class lt.monarch.data.binding.DataSource
generateColumnTypesFromMappings, getOrder, setOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDataSource

public ObjectDataSource(java.util.List<?> dataList)
Method Detail

getDataList

public java.util.List<?> getDataList()

setDataList

public void setDataList(java.util.List<?> dataList)

updateDataModel

public void updateDataModel(DataBinding binding,
                            DataModel model)
Description copied from class: DataSource
Retrieves data according to DataBinding object form data source and stores it in DataModel object.

Specified by:
updateDataModel in class DataSource
Parameters:
binding - DataBinding describes the data that should be taken form data source
model - DataModel which values should be updated

getLimit

public java.lang.Integer getLimit()
Description copied from interface: Filterable
Returns result limit

Specified by:
getLimit in interface Filterable
Returns:

getStartRecord

public int getStartRecord()
Description copied from interface: Filterable
Return index of the first record. Default is 0.

Specified by:
getStartRecord in interface Filterable
Returns:
Index of the first record in data source.

setLimit

public void setLimit(java.lang.Integer size)
Description copied from interface: Filterable
Sets limit for results. Default value is null - this means that all values from data source should be retrieved. If the concrete value is set then DataSource will retrieve not more than the given amount of data. For example, if limit is set to 4 then DataSource will retrieve maximum 4 result rows.

Specified by:
setLimit in interface Filterable

setStartRecord

public void setStartRecord(int index)
Description copied from interface: Filterable
Sets index of the first record that should be retrieved. For example, if startRecord=3 then DataSource will skip rows with the index 0, 1 or 2 and will start reading from the row with the index 3.

Specified by:
setStartRecord in interface Filterable
Parameters:
index - first record index

getFilterCondition

public java.lang.String getFilterCondition()
Description copied from interface: Filterable
Returns additional filter conditions

Specified by:
getFilterCondition in interface Filterable
Returns:
String value showing additional conditions to the filter

setFilterCondition

public void setFilterCondition(java.lang.String condition)
Description copied from interface: Filterable
Sets additional filter conditions

Specified by:
setFilterCondition in interface Filterable
Parameters:
condition - Filter conditions