public abstract class CsvMarshaller extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
CsvMarshaller(org.apache.commons.csv.CSVFormat format) |
| Modifier and Type | Method and Description |
|---|---|
static CsvMarshaller |
create(org.apache.commons.csv.CSVFormat format,
CsvDataFormat dataFormat)
Creates a new instance.
|
protected org.apache.commons.csv.CSVPrinter |
createPrinter(org.apache.camel.Exchange exchange,
OutputStream outputStream)
Creates and returns a
CSVPrinter. |
protected abstract Iterable<?> |
getMapRecordValues(Map<?,?> map)
Gets the CSV record values of the given map.
|
void |
marshal(org.apache.camel.Exchange exchange,
Object object,
OutputStream outputStream)
Marshals the given object into the given stream.
|
public static CsvMarshaller create(org.apache.commons.csv.CSVFormat format, CsvDataFormat dataFormat)
format - CSV formatdataFormat - Camel CSV data formatpublic void marshal(org.apache.camel.Exchange exchange,
Object object,
OutputStream outputStream)
throws org.apache.camel.NoTypeConversionAvailableException,
IOException
exchange - Exchange (used for access to type conversion)object - Body to marshaloutputStream - Output stream of the CSVorg.apache.camel.NoTypeConversionAvailableException - if the body cannot be convertedIOException - if we cannot write into the given streamprotected org.apache.commons.csv.CSVPrinter createPrinter(org.apache.camel.Exchange exchange,
OutputStream outputStream)
throws IOException
CSVPrinter.exchange - Exchange (used for access to type conversion). Could NOT be null.outputStream - Output stream of the CSV. Could NOT be null.CSVPrinter. Never null.IOExceptionApache Camel