public class FlatFileItemWriterBuilder<T>
extends java.lang.Object
FlatFileItemWriter
FlatFileItemWriter
Constructor and Description |
---|
FlatFileItemWriterBuilder() |
Modifier and Type | Method and Description |
---|---|
FlatFileItemWriterBuilder<T> |
append(boolean append)
If set to true and the file exists, the output will be appended to the existing
file.
|
FlatFileItemWriter<T> |
build()
Validates and builds a
FlatFileItemWriter . |
FlatFileItemWriterBuilder<T> |
encoding(java.lang.String encoding)
Encoding used for output.
|
FlatFileItemWriterBuilder<T> |
footerCallback(FlatFileFooterCallback callback)
A callback for footer processing
|
FlatFileItemWriterBuilder<T> |
forceSync(boolean forceSync)
A flag indicating that changes should be force-synced to disk on flush.
|
FlatFileItemWriterBuilder<T> |
headerCallback(FlatFileHeaderCallback callback)
A callback for header processing.
|
FlatFileItemWriterBuilder<T> |
lineAggregator(LineAggregator<T> lineAggregator)
Line aggregator used to build the String version of each item.
|
FlatFileItemWriterBuilder<T> |
lineSeparator(java.lang.String lineSeparator)
String used to separate lines in output.
|
FlatFileItemWriterBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
FlatFileItemWriterBuilder<T> |
resource(org.springframework.core.io.Resource resource)
The
Resource to be used as output. |
FlatFileItemWriterBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
FlatFileItemWriterBuilder<T> |
shouldDeleteIfEmpty(boolean shouldDelete)
If set to true, once the step is complete, if the resource previously provdied is
empty, it will be deleted.
|
FlatFileItemWriterBuilder<T> |
shouldDeleteIfExists(boolean shouldDelete)
If set to true, upon the start of the step, if the resource already exists, it will
be deleted and recreated.
|
FlatFileItemWriterBuilder<T> |
transactional(boolean transactional)
If set to true, the flushing of the buffer is delayed while a transaction is active.
|
public FlatFileItemWriterBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic FlatFileItemWriterBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public FlatFileItemWriterBuilder<T> resource(org.springframework.core.io.Resource resource)
Resource
to be used as output.resource
- the output of the writer.FlatFileItemWriter.setResource(Resource)
public FlatFileItemWriterBuilder<T> forceSync(boolean forceSync)
forceSync
- value to set the flag toFlatFileItemWriter.setForceSync(boolean)
public FlatFileItemWriterBuilder<T> lineSeparator(java.lang.String lineSeparator)
lineSeparator
- value to use for a line separatorFlatFileItemWriter.setLineSeparator(String)
public FlatFileItemWriterBuilder<T> lineAggregator(LineAggregator<T> lineAggregator)
lineAggregator
- LineAggregator
implementationFlatFileItemWriter.setLineAggregator(LineAggregator)
public FlatFileItemWriterBuilder<T> encoding(java.lang.String encoding)
encoding
- encoding type.FlatFileItemWriter.setEncoding(String)
public FlatFileItemWriterBuilder<T> shouldDeleteIfEmpty(boolean shouldDelete)
shouldDelete
- defaults to falseFlatFileItemWriter.setShouldDeleteIfEmpty(boolean)
public FlatFileItemWriterBuilder<T> shouldDeleteIfExists(boolean shouldDelete)
shouldDelete
- defaults to trueFlatFileItemWriter.setShouldDeleteIfExists(boolean)
public FlatFileItemWriterBuilder<T> append(boolean append)
append
- defaults to falseFlatFileItemWriter.setAppendAllowed(boolean)
public FlatFileItemWriterBuilder<T> headerCallback(FlatFileHeaderCallback callback)
callback
- FlatFileHeaderCallback
implFlatFileItemWriter.setHeaderCallback(FlatFileHeaderCallback)
public FlatFileItemWriterBuilder<T> footerCallback(FlatFileFooterCallback callback)
callback
- FlatFileFooterCallback
implFlatFileItemWriter.setFooterCallback(FlatFileFooterCallback)
public FlatFileItemWriterBuilder<T> transactional(boolean transactional)
transactional
- defaults to trueFlatFileItemWriter.setTransactional(boolean)
public FlatFileItemWriter<T> build()
FlatFileItemWriter
.FlatFileItemWriter