@Named @Dependent public class CsvItemWriter extends CsvItemReaderWriterBase implements javax.batch.api.chunk.ItemWriter
javax.batch.api.chunk.ItemWriter
that writes data to CSV file or resource.
This class is not designed to be thread-safe and its instance should not be shared between threads.CsvItemReaderWriterBase
,
CsvItemReader
Modifier and Type | Field and Description |
---|---|
protected org.supercsv.io.ICsvWriter |
delegateWriter |
protected String[] |
header
Specifies the CSV header row to write out.
|
protected String |
writeComments
Specifies the complete comment line that can be recognized by any tools or programs intended to read the current
CSV output.
|
protected String |
writeMode
Instructs
org.jberet.support.io.CsvItemWriter , when the target CSV resource already
exists, whether to append to, or overwrite the existing resource, or fail. |
beanType, cellProcessorInstances, cellProcessors, charset, commentMatcher, delimiterChar, encoder, endOfLineSymbols, nameMapping, preference, quoteChar, quoteMode, surroundingSpacesNeedQuotes
NEW_LINE, resource, skipBeanValidation
Constructor and Description |
---|
CsvItemWriter() |
Modifier and Type | Method and Description |
---|---|
Serializable |
checkpointInfo() |
void |
close() |
void |
open(Serializable checkpoint) |
void |
writeItems(List<Object> items) |
getCellProcessors, getCommentMatcher, getCsvPreference, getEncoder, getNameMapping, getQuoteMode
getInputStream, getOutputStream, getValidator, validate
@Inject protected String[] header
@Inject protected String writeComments
@Inject protected String writeMode
org.jberet.support.io.CsvItemWriter
, when the target CSV resource already
exists, whether to append to, or overwrite the existing resource, or fail. Valid values are append
,
overwrite
, and failIfExists
. Optional property, and defaults to append
.protected org.supercsv.io.ICsvWriter delegateWriter
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 void writeItems(List<Object> items) throws Exception
writeItems
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.