public class CsvRecordParser extends Object implements RecordMarshaller, RecordUnmarshaller
RecordMarshaller
and RecordUnmarshaller
implementation
for CSV formatted records.Constructor and Description |
---|
CsvRecordParser()
Constructs a new CsvRecordParser.
|
CsvRecordParser(CsvParserConfiguration config)
Constructs a new CsvRecordParser.
|
Modifier and Type | Method and Description |
---|---|
String |
marshal(Object record)
Marshals a single record object to a String.
|
String |
marshal(String[] record)
Marshals a String array into a CSV formatted record.
|
Object |
unmarshal(String text)
Unmarshals a single record.
|
public CsvRecordParser()
public CsvRecordParser(CsvParserConfiguration config)
config
- the CsvParserConfiguration
public Object unmarshal(String text) throws RecordIOException
RecordUnmarshaller
unmarshal
in interface RecordUnmarshaller
text
- the record text to unmarshalRecordIOException
- if the record is malformed and cannot be parsedpublic String marshal(Object record)
RecordMarshaller
marshal
in interface RecordMarshaller
record
- the record object to marshal