- java.lang.Object
- 
- com.gluonhq.connect.provider.InputStreamListDataReader<E>
 
- 
- Type Parameters:
- E- the type of the objects contained in the list to read
 - All Implemented Interfaces:
- ListDataReader<E>
 
 public class InputStreamListDataReader<E> extends Object implements ListDataReader<E> A helper class that represents aListDataReaderthat reads objects by reading from a specificInputDataSourceand converts the read data with a specificInputStreamIterableInputConverter.
- 
- 
Constructor SummaryConstructors Constructor Description InputStreamListDataReader(InputDataSource dataSource, InputStreamIterableInputConverter<E> converter)Construct an instance that will use the specified data source to read data from and convert it to a list of objects with the specified converter.
 - 
Method SummaryAll 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.
 
- 
- 
- 
Constructor Detail- 
InputStreamListDataReaderpublic InputStreamListDataReader(InputDataSource dataSource, InputStreamIterableInputConverter<E> converter) Construct an instance that will use the specified data source to read data from and convert it to a list of objects with the specified converter. The InputStream of the InputDataSource will be set on the Converter before calling itsiteratormethod.- Parameters:
- dataSource- the data source where the data will be read from
- converter- the converter that is used for converting the data into a list of object
 
 
- 
 - 
Method Detail- 
newGluonObservableListpublic GluonObservableList<E> newGluonObservableList() Description copied from interface:ListDataReaderProvide 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:
- newGluonObservableListin interface- ListDataReader<E>
- Returns:
- an instance of GluonObservableList
 
 - 
iteratorpublic Iterator<E> iterator() throws IOException Returns an iterator that is able to iterate over the read objects from the list. This implementation uses the specified converter to convert the data that is read from the specified data source into a list of objects. The InputStream of the specified data source will be set on the converter, before calling theiteratormethod on the converter.- Specified by:
- iteratorin interface- ListDataReader<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
 
 
- 
 
-