use of org.supercsv.io.CsvBeanReader in project apex-malhar by apache.
the class CsvParser method setup.
@Override
public void setup(OperatorContext context) {
delimitedParserSchema = new DelimitedSchema(schema);
preference = new CsvPreference.Builder(delimitedParserSchema.getQuoteChar(), delimitedParserSchema.getDelimiterChar(), delimitedParserSchema.getLineDelimiter()).build();
nameMapping = delimitedParserSchema.getFieldNames().toArray(new String[delimitedParserSchema.getFieldNames().size()]);
header = StringUtils.join(nameMapping, (char) delimitedParserSchema.getDelimiterChar() + "");
processors = getProcessor(delimitedParserSchema.getFields());
csvStringReader = new ReusableStringReader();
csvMapReader = new CsvMapReader(csvStringReader, preference);
csvBeanReader = new CsvBeanReader(csvStringReader, preference);
}
Aggregations