java.lang.Object
org.simpleflatmapper.csv.impl.CsvMapperImpl<T>
- All Implemented Interfaces:
CsvMapper<T>,org.simpleflatmapper.map.ContextualSourceMapper<CsvRow,,T> org.simpleflatmapper.map.EnumerableMapper<CsvRowSet,,T, IOException> org.simpleflatmapper.map.SetRowMapper<CsvRow,,CsvRowSet, T, IOException> org.simpleflatmapper.map.SourceMapper<CsvRow,T>
-
Constructor Summary
ConstructorsConstructorDescriptionCsvMapperImpl(org.simpleflatmapper.map.SetRowMapper<CsvRow, CsvRowSet, T, IOException> setRowMapper, CsvColumnKey[] keys) -
Method Summary
Modifier and TypeMethodDescriptionorg.simpleflatmapper.util.Enumerable<T><H extends org.simpleflatmapper.util.CheckedConsumer<? super T>>
HWill map each row of the content of reader to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>>
HWill map each row of the content of reader, starting at rowStart, to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>>
HWill map each row of the content of reader, starting at rowStart and ending before rowEnd, to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>>
H<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>>
HforEach(org.simpleflatmapper.lightningcsv.CsvReader reader, H handle) Will map each row of the content of reader to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>>
HforEach(org.simpleflatmapper.lightningcsv.CsvReader reader, H handle, int limit) Will map each row of the content of reader, starting at rowStart and ending before rowEnd, to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.Will return an iterator on the reader that will return a mapped object for each row.Will return an iterator on the reader that will return a mapped object for each row.iterator(org.simpleflatmapper.lightningcsv.CsvReader reader) Will return an iterator on the reader that will return a mapped object for each row.Will return a Stream of TWill return a Stream of T.stream(org.simpleflatmapper.lightningcsv.CsvReader reader) Will return a Stream of T
-
Constructor Details
-
CsvMapperImpl
public CsvMapperImpl(org.simpleflatmapper.map.SetRowMapper<CsvRow, CsvRowSet, T, IOException> setRowMapper, CsvColumnKey[] keys)
-
-
Method Details
-
forEach
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(Reader reader, H handle) throws IOException, org.simpleflatmapper.map.MappingException Description copied from interface:CsvMapperWill map each row of the content of reader to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.The method will return the handler passed as an argument so you can easily chain the calls like
List<T> list = jdbcMapper.forEach(reader, new ListHandler<T>()).getList();- Specified by:
forEachin interfaceCsvMapper<T>- Type Parameters:
H- the row handler type- Parameters:
reader- the readerhandle- the callback newInstance- Returns:
- the callback newInstance
- Throws:
IOException- if an io error occursorg.simpleflatmapper.map.MappingException- if an mapping error occurs
-
forEach
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(org.simpleflatmapper.lightningcsv.CsvReader reader, H handle) throws IOException, org.simpleflatmapper.map.MappingException Description copied from interface:CsvMapperWill map each row of the content of reader to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.- Specified by:
forEachin interfaceCsvMapper<T>- Type Parameters:
H- the row handler type- Parameters:
reader- the readerhandle- the callback newInstance- Returns:
- the callback newInstance
- Throws:
IOException- if an io error occursorg.simpleflatmapper.map.MappingException- if an mapping error occurs
-
forEach
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(Reader reader, H handle, int skip) throws IOException, org.simpleflatmapper.map.MappingException Description copied from interface:CsvMapperWill map each row of the content of reader, starting at rowStart, to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.- Specified by:
forEachin interfaceCsvMapper<T>- Type Parameters:
H- the row handler type- Parameters:
reader- the readerhandle- the callback newInstanceskip- the number of row to skip- Returns:
- the callback newInstance
- Throws:
IOException- if an io error occursorg.simpleflatmapper.map.MappingException- if an mapping error occurs
-
forEach
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(Reader reader, H handle, int skip, int limit) throws IOException, org.simpleflatmapper.map.MappingException Description copied from interface:CsvMapperWill map each row of the content of reader, starting at rowStart and ending before rowEnd, to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.- Specified by:
forEachin interfaceCsvMapper<T>- Type Parameters:
H- the row handler type- Parameters:
reader- the readerhandle- the callback newInstanceskip- the number of row to skiplimit- the number of row to process- Returns:
- the callback newInstance
- Throws:
IOException- if an io error occursorg.simpleflatmapper.map.MappingException- if an mapping error occurs
-
forEach
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(org.simpleflatmapper.lightningcsv.CsvReader reader, H handle, int limit) throws IOException, org.simpleflatmapper.map.MappingException Description copied from interface:CsvMapperWill map each row of the content of reader, starting at rowStart and ending before rowEnd, to an object of type T and will pass that object to the handle via theCheckedConsumer.handler(T t) call back.- Specified by:
forEachin interfaceCsvMapper<T>- Type Parameters:
H- the row handler type- Parameters:
reader- the readerhandle- the callback newInstancelimit- the number of row to process- Returns:
- the callback newInstance
- Throws:
IOException- if an io error occursorg.simpleflatmapper.map.MappingException- if an mapping error occurs
-
iterator
Description copied from interface:CsvMapperWill return an iterator on the reader that will return a mapped object for each row.- Specified by:
iteratorin interfaceCsvMapper<T>- Parameters:
reader- the reader- Returns:
- an iterator on the file
- Throws:
IOException- if an io error occurs
-
iterator
Description copied from interface:CsvMapperWill return an iterator on the reader that will return a mapped object for each row.- Specified by:
iteratorin interfaceCsvMapper<T>- Parameters:
reader- the reader- Returns:
- an iterator on the file
- Throws:
IOException- if an io error occurs
-
iterator
Description copied from interface:CsvMapperWill return an iterator on the reader that will return a mapped object for each row.- Specified by:
iteratorin interfaceCsvMapper<T>- Parameters:
reader- the readerskip- the number of row to skip- Returns:
- an iterator on the file
- Throws:
IOException- if an io error occurs
-
stream
Description copied from interface:CsvMapperWill return a Stream of T- Specified by:
streamin interfaceCsvMapper<T>- Parameters:
reader- the reader- Returns:
- stream of T
- Throws:
IOException- if an io error occurs
-
stream
Description copied from interface:CsvMapperWill return a Stream of T- Specified by:
streamin interfaceCsvMapper<T>- Parameters:
reader- the reader- Returns:
- stream of T
- Throws:
IOException- if an io error occurs
-
stream
Description copied from interface:CsvMapperWill return a Stream of T.- Specified by:
streamin interfaceCsvMapper<T>- Parameters:
reader- the readerskip- the number of row to skip- Returns:
- stream of T
- Throws:
IOException- if an io error occurs
-
forEach
public <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(CsvRowSet source, H handler) throws IOException, org.simpleflatmapper.map.MappingException - Specified by:
forEachin interfaceorg.simpleflatmapper.map.EnumerableMapper<CsvRowSet,T, IOException> - Throws:
IOExceptionorg.simpleflatmapper.map.MappingException
-
iterator
public Iterator<T> iterator(CsvRowSet source) throws IOException, org.simpleflatmapper.map.MappingException - Specified by:
iteratorin interfaceorg.simpleflatmapper.map.EnumerableMapper<CsvRowSet,T, IOException> - Throws:
IOExceptionorg.simpleflatmapper.map.MappingException
-
stream
public Stream<T> stream(CsvRowSet source) throws IOException, org.simpleflatmapper.map.MappingException - Specified by:
streamin interfaceorg.simpleflatmapper.map.EnumerableMapper<CsvRowSet,T, IOException> - Throws:
IOExceptionorg.simpleflatmapper.map.MappingException
-
enumerate
public org.simpleflatmapper.util.Enumerable<T> enumerate(CsvRowSet source) throws IOException, org.simpleflatmapper.map.MappingException - Specified by:
enumeratein interfaceorg.simpleflatmapper.map.EnumerableMapper<CsvRowSet,T, IOException> - Throws:
IOExceptionorg.simpleflatmapper.map.MappingException
-
map
-
map
-