It would be interesting to use a customize ReadProcessor and be able to read the full CSVRecord before processing. This is usefull if you have a ragged csv file and you want to skip some lines. A solution is to modify the private method getCSVRecord to
protected T getCSVRecord(CSVRecord record, Map<Integer, CSVReadAnnotationManager> map) throws InstantiationException, IllegalAccessException
and inject its own ReadProcessor to the CSVProcessor. Two solutions :
- either create a public method
getReadProcessor() in CSVProcessor and use it instead of the field readProcessor
- or inject it via constructor.
The CSVNamedReadProcessor and the CSVOrderReadProcessor must be extendable (they must be public) as one wants to override their getCSVRecord method.
It would be interesting to use a customize ReadProcessor and be able to read the full CSVRecord before processing. This is usefull if you have a ragged csv file and you want to skip some lines. A solution is to modify the private method
getCSVRecordtoprotected T getCSVRecord(CSVRecord record, Map<Integer, CSVReadAnnotationManager> map) throws InstantiationException, IllegalAccessExceptionand inject its own ReadProcessor to the CSVProcessor. Two solutions :
getReadProcessor()in CSVProcessor and use it instead of the fieldreadProcessorThe
CSVNamedReadProcessorand theCSVOrderReadProcessormust be extendable (they must be public) as one wants to override theirgetCSVRecordmethod.