Class CsvColNumberMapReader
- java.lang.Object
-
- org.supercsv.io.AbstractCsvReader
-
- org.ametys.plugins.contentio.in.csv.CsvColNumberMapReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ICsvMapReader
,ICsvReader
public class CsvColNumberMapReader extends AbstractCsvReader implements ICsvMapReader
Custom CsvMapReader which uses the column number as the map index.
The nameMapping parameter in the two read methods will not be used.
-
-
Constructor Summary
Constructors Constructor Description CsvColNumberMapReader(Reader reader, CsvPreference preferences)
Constructs a newCsvMapReader
with the supplied Reader and CSV preferences.CsvColNumberMapReader(ITokenizer tokenizer, CsvPreference preferences)
Constructs a newCsvMapReader
with the supplied (custom) Tokenizer and CSV preferences.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
read(String... nameMapping)
Map<String,Object>
read(String[] nameMapping, CellProcessor[] processors)
-
Methods inherited from class org.supercsv.io.AbstractCsvReader
close, executeProcessors, get, getColumns, getHeader, getLineNumber, getPreferences, getRowNumber, getUntokenizedRow, length, readRow
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.supercsv.io.ICsvReader
get, getHeader, getLineNumber, getRowNumber, getUntokenizedRow, length
-
-
-
-
Constructor Detail
-
CsvColNumberMapReader
public CsvColNumberMapReader(Reader reader, CsvPreference preferences)
Constructs a newCsvMapReader
with the supplied Reader and CSV preferences. Note that thereader
will be wrapped in aBufferedReader
before accessed.- Parameters:
reader
- the readerpreferences
- the CSV preferences- Throws:
NullPointerException
- if reader or preferences are null
-
CsvColNumberMapReader
public CsvColNumberMapReader(ITokenizer tokenizer, CsvPreference preferences)
Constructs a newCsvMapReader
with the supplied (custom) Tokenizer and CSV preferences. The tokenizer should be set up with the Reader (CSV input) and CsvPreference beforehand.- Parameters:
tokenizer
- the tokenizerpreferences
- the CSV preferences- Throws:
NullPointerException
- if tokenizer or preferences are null
-
-
Method Detail
-
read
public Map<String,String> read(String... nameMapping) throws IOException
- Specified by:
read
in interfaceICsvMapReader
- Throws:
IOException
-
read
public Map<String,Object> read(String[] nameMapping, CellProcessor[] processors) throws IOException
- Specified by:
read
in interfaceICsvMapReader
- Throws:
IOException
-
-