@Named @Dependent public class JacksonCsvItemWriter extends JacksonCsvItemReaderWriterBase implements javax.batch.api.chunk.ItemWriter
javax.batch.api.chunk.ItemWriter
that writes data in CSV format using jackson-dataformat-csv.CsvItemWriter
,
JacksonCsvItemReader
,
JacksonCsvItemReaderWriterBase
Modifier and Type | Field and Description |
---|---|
protected com.fasterxml.jackson.dataformat.csv.CsvGenerator |
csvGenerator |
protected Map<String,String> |
csvGeneratorFeatures
A comma-separated list of key-value pairs that specify
com.fasterxml.jackson.dataformat.csv.CsvGenerator.Feature . |
protected Map<String,String> |
jsonGeneratorFeatures
A comma-separated list of key-value pairs that specify
com.fasterxml.jackson.core.JsonGenerator features. |
protected String |
lineSeparator
Character used to separate data rows.
|
protected Class |
outputDecorator
Fully-qualified name of a class that implements
com.fasterxml.jackson.core.io.OutputDecorator , which
can be used to decorate output destinations. |
protected String |
writeMode
Instructs this class, when the target CSV resource already exists, whether to append to, or overwrite
the existing resource, or fail.
|
beanType, columns, columnSeparator, csvMapper, nullValue, quoteChar, useHeader
customDataTypeModules, customDeserializers, customSerializers, deserializationFeatures, jsonFactory, jsonFactoryFeatures, jsonFactoryLookup, mapperFeatures, objectMapper, serializationFeatures
NEW_LINE, resource, skipBeanValidation
Constructor and Description |
---|
JacksonCsvItemWriter() |
Modifier and Type | Method and Description |
---|---|
Serializable |
checkpointInfo() |
void |
close() |
void |
open(Serializable checkpoint) |
void |
writeItems(List<Object> items) |
buildCsvSchema, init, initJsonFactory
initJsonFactoryAndObjectMapper, registerModule
getInputStream, getOutputStream, getValidator, validate
@Inject protected String writeMode
append
, overwrite
, and failIfExists
.
Optional property, and defaults to append
.@Inject protected String lineSeparator
@Inject protected Map<String,String> jsonGeneratorFeatures
com.fasterxml.jackson.core.JsonGenerator
features.
Optional property and defaults to null. Keys and values must be defined in
com.fasterxml.jackson.core.JsonGenerator.Feature
. For example,
WRITE_BIGDECIMAL_AS_PLAIN=true, WRITE_NUMBERS_AS_STRINGS=true, QUOTE_NON_NUMERIC_NUMBERS=false
@Inject protected Map<String,String> csvGeneratorFeatures
com.fasterxml.jackson.dataformat.csv.CsvGenerator.Feature
.
Optional property and defaults to null. For example,
ALWAYS_QUOTE_STRINGS=false, STRICT_CHECK_FOR_QUOTING=true, OMIT_MISSING_TAIL_COLUMNS=falseWith the above configuration, this writer will quote string values only when necessary, and will omit columns without matching value when they are the last values of the row.
@Inject protected Class outputDecorator
com.fasterxml.jackson.core.io.OutputDecorator
, which
can be used to decorate output destinations. Typical use is to use a filter abstraction (filtered output stream,
writer) around original output destination, and apply additional processing during write operations.
Optional property and defaults to null. For example,
org.jberet.support.io.JsonItemReaderTest$NoopOutputDecorator
protected com.fasterxml.jackson.dataformat.csv.CsvGenerator csvGenerator
public void writeItems(List<Object> items) throws Exception
writeItems
in interface javax.batch.api.chunk.ItemWriter
Exception
public void open(Serializable checkpoint) throws Exception
open
in interface javax.batch.api.chunk.ItemWriter
Exception
public void close() throws Exception
close
in interface javax.batch.api.chunk.ItemWriter
Exception
public Serializable checkpointInfo() throws Exception
checkpointInfo
in interface javax.batch.api.chunk.ItemWriter
Exception
Copyright © 2018 JBoss by Red Hat. All rights reserved.