|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.dataformat.csv.CsvDataFormat
public class CsvDataFormat
CSV Data format.
By default, columns are autogenerated in the resulting CSV. Subsequent messages use the previously created columns with new fields being added at the end of the line. Thus, field order is the same from message to message. Autogeneration can be disabled. In this case, only the fields defined in csvConfig are written on the output.
| Constructor Summary | |
|---|---|
CsvDataFormat()
|
|
| Method Summary | |
|---|---|
org.apache.commons.csv.writer.CSVConfig |
getConfig()
|
String |
getDelimiter()
|
org.apache.commons.csv.CSVStrategy |
getStrategy()
|
boolean |
isAutogenColumns()
|
void |
marshal(Exchange exchange,
Object object,
OutputStream outputStream)
Marshals the object to the given Stream. |
void |
setAutogenColumns(boolean autogenColumns)
Auto generate columns. |
void |
setConfig(org.apache.commons.csv.writer.CSVConfig config)
|
void |
setDelimiter(String delimiter)
|
void |
setStrategy(org.apache.commons.csv.CSVStrategy strategy)
|
Object |
unmarshal(Exchange exchange,
InputStream inputStream)
Unmarshals the given stream into an object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CsvDataFormat()
| Method Detail |
|---|
public void marshal(Exchange exchange,
Object object,
OutputStream outputStream)
throws Exception
DataFormat
marshal in interface DataFormatexchange - the current exchangeobject - the object to be marshalledoutputStream - the output stream to write the marshalled result to
Exception - can be thrown
public Object unmarshal(Exchange exchange,
InputStream inputStream)
throws Exception
DataFormat
unmarshal in interface DataFormatexchange - the current exchangeinputStream - the input stream with the object to be unmarshalled
Exception - can be thrownpublic String getDelimiter()
public void setDelimiter(String delimiter)
public org.apache.commons.csv.writer.CSVConfig getConfig()
public void setConfig(org.apache.commons.csv.writer.CSVConfig config)
public org.apache.commons.csv.CSVStrategy getStrategy()
public void setStrategy(org.apache.commons.csv.CSVStrategy strategy)
public boolean isAutogenColumns()
public void setAutogenColumns(boolean autogenColumns)
autogenColumns - set to false to disallow column autogeneration (default true)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||