org.nuiton.util.csv
Class ImportToMap
java.lang.Object
org.nuiton.util.csv.Import<Map<String,Object>>
org.nuiton.util.csv.ImportToMap
- All Implemented Interfaces:
- Closeable, Iterable<Map<String,Object>>
public class ImportToMap
- extends Import<Map<String,Object>>
A extended Import to read csv lines into a single map.
Warning: The map used to push values for a csv line is the
same for all lines, it means you have to copy to your own object.
- Since:
- 2.4
- Author:
- tchemit
| Methods inherited from class org.nuiton.util.csv.Import |
checkAllMandatoryHeadersArePresent, checkHeaderNamesAreAllKnown, checkUniqueModelColumnNames, close, getAllMandatoryHeaders, getHeaders, getNonIgnoredHeaders, newImport, newImport, parseValue, prepareAndValidate, readRow, readValue, setValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImportToMap
protected ImportToMap(ImportModel<Map<String,Object>> mapImportModel,
InputStream inputStream)
ImportToMap
protected ImportToMap(ImportModel<Map<String,Object>> mapImportModel,
Reader reader)
newImport
public static ImportToMap newImport(ImportModel<Map<String,Object>> model,
InputStream inputStream)
newImport
public static ImportToMap newImport(ImportModel<Map<String,Object>> model,
Reader reader)
iterator
public Iterator<Map<String,Object>> iterator()
- Description copied from class:
Import
- Define iterator over import. First of all, the input stream will be
validated based on defined model. Iteration will be done on all csv
rows except first headers line.
- Specified by:
iterator in interface Iterable<Map<String,Object>>- Overrides:
iterator in class Import<Map<String,Object>>
- Returns:
- the Iterator used for csv iteration
- See Also:
Import.prepareAndValidate()
Copyright © 2011 CodeLutin. All Rights Reserved.