T
- Class to convert the objects to.public class IterableCSVToBean<T> extends AbstractCSVToBean implements Iterable<T>
Constructor and Description |
---|
IterableCSVToBean(CSVReader csvReader,
MappingStrategy<T> strategy,
CsvToBeanFilter filter)
IterableCSVToBean constructor
|
Modifier and Type | Method and Description |
---|---|
protected CSVReader |
getCSVReader()
Retrieves the CSVReader.
|
protected CsvToBeanFilter |
getFilter()
Retrieves the CsvToBeanFilter
|
protected PropertyEditor |
getPropertyEditor(PropertyDescriptor desc)
Attempt to find custom property editor on descriptor first, else try the
propery editor manager.
|
protected MappingStrategy<T> |
getStrategy()
Retrieves the MappingStrategy.
|
Iterator<T> |
iterator() |
T |
nextLine()
Reads and processes a single line.
|
checkForTrim, convertValue, getPropertyEditorValue
public IterableCSVToBean(CSVReader csvReader, MappingStrategy<T> strategy, CsvToBeanFilter filter)
csvReader
- CSVReader. Should not be null.strategy
- MappingStrategy used to map CSV data to the bean. Should not be null.filter
- Optional CsvToBeanFilter used remove unwanted data from reads.protected MappingStrategy<T> getStrategy()
protected CSVReader getCSVReader()
protected CsvToBeanFilter getFilter()
public T nextLine() throws IllegalAccessException, InstantiationException, IOException, IntrospectionException, InvocationTargetException, CsvRequiredFieldEmptyException
IllegalAccessException
- Thrown if there is a failure in introspection.InstantiationException
- Thrown when getting the PropertyDescriptor for the class.IOException
- Thrown when there is an unexpected error reading the file.IntrospectionException
- Thrown if there is a failure in introspection.InvocationTargetException
- Thrown if there is a failure in introspection.CsvRequiredFieldEmptyException
- If a field is required, but the
header or column position for the field is not present in the inputprotected PropertyEditor getPropertyEditor(PropertyDescriptor desc) throws InstantiationException, IllegalAccessException
AbstractCSVToBean
getPropertyEditor
in class AbstractCSVToBean
desc
- PropertyDescriptor.InstantiationException
- Thrown when getting the PropertyEditor for the class.IllegalAccessException
- Thrown when getting the PropertyEditor for the class.Copyright © 2017. All rights reserved.