BeanIO 2.0.4

org.beanio.stream.csv
Class CsvRecordParser

java.lang.Object
  extended by org.beanio.stream.csv.CsvRecordParser
All Implemented Interfaces:
RecordMarshaller, RecordUnmarshaller

public class CsvRecordParser
extends Object
implements RecordMarshaller, RecordUnmarshaller

' A combined RecordMarshaller and RecordUnmarshaller implementation for CSV formatted records.

Since:
2.0
Author:
Kevin Seim

Constructor Summary
CsvRecordParser()
          Constructs a new CsvRecordParser.
CsvRecordParser(CsvParserConfiguration config)
          Constructs a new CsvRecordParser.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvRecordParser

public CsvRecordParser()
Constructs a new CsvRecordParser.


CsvRecordParser

public CsvRecordParser(CsvParserConfiguration config)
Constructs a new CsvRecordParser.

Parameters:
config - the CsvParserConfiguration
Method Detail

unmarshal

public Object unmarshal(String text)
                 throws RecordIOException
Description copied from interface: RecordUnmarshaller
Unmarshals a single record.

Specified by:
unmarshal in interface RecordUnmarshaller
Parameters:
text - the record text to unmarshal
Returns:
the unmarshalled record object
Throws:
RecordIOException - if the record is malformed and cannot be parsed

marshal

public String marshal(Object record)
Description copied from interface: RecordMarshaller
Marshals a single record object to a String.

Specified by:
marshal in interface RecordMarshaller
Parameters:
record - the record object to marshal
Returns:
the marshalled record text

marshal

public String marshal(String[] record)
Marshals a String array into a CSV formatted record.

Parameters:
record - the String[] to marshal
Returns:
the CSV formatted record

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim