- java.lang.Object
-
- com.gluonhq.connect.provider.BaseRestProvider
-
- com.gluonhq.connect.provider.RestListDataReader<E>
-
- All Implemented Interfaces:
ListDataReader<E>
public class RestListDataReader<E> extends BaseRestProvider implements ListDataReader<E>
-
-
Field Summary
-
Fields inherited from class com.gluonhq.connect.provider.BaseRestProvider
CONTENT_TYPE_APPLICATION_JSON, CONTENT_TYPE_TEXT_PLAIN, dataSource
-
-
Constructor Summary
Constructors Constructor Description RestListDataReader(RestDataSource dataSource, InputStreamIterableInputConverter<E> inputConverter)
RestListDataReader(RestDataSource dataSource, Class<E> targetClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<E>
iterator()
Returns an iterator that is able to iterate over the read objects from the list.GluonObservableList<E>
newGluonObservableList()
Provide an instance of a GluonObservableList.-
Methods inherited from class com.gluonhq.connect.provider.BaseRestProvider
getRestDataSource
-
-
-
-
Constructor Detail
-
RestListDataReader
public RestListDataReader(RestDataSource dataSource, Class<E> targetClass)
-
RestListDataReader
public RestListDataReader(RestDataSource dataSource, InputStreamIterableInputConverter<E> inputConverter)
-
-
Method Detail
-
newGluonObservableList
public GluonObservableList<E> newGluonObservableList()
Description copied from interface:ListDataReader
Provide an instance of a GluonObservableList. This method will be called byDataProvider.retrieveList(ListDataReader)
to get a GluonObservableList that can be populated. Most implementations will just return an instance of GluonObservableList itself. Note that it is perfectly valid to return existing instances of GluonObservableList.- Specified by:
newGluonObservableList
in interfaceListDataReader<E>
- Returns:
- an instance of GluonObservableList
-
iterator
public Iterator<E> iterator() throws IOException
Description copied from interface:ListDataReader
Returns an iterator that is able to iterate over the read objects from the list. This method will be called byDataProvider.retrieveList(ListDataReader)
to initiate the read process. The returned iterator will be used to populate the GluonObservableList that is returned in theListDataReader.newGluonObservableList()
method.- Specified by:
iterator
in interfaceListDataReader<E>
- Returns:
- an iterator that is able to read over the objects from the list
- Throws:
IOException
- when something went wrong during the process of reading the objects
-
-