public class FlatFileItemWriterBuilder<T>
extends java.lang.Object
FlatFileItemWriter
FlatFileItemWriter
Modifier and Type | Class and Description |
---|---|
static class |
FlatFileItemWriterBuilder.DelimitedBuilder<T>
A builder for constructing a
DelimitedLineAggregator |
static class |
FlatFileItemWriterBuilder.FormattedBuilder<T>
A builder for constructing a
FormatterLineAggregator . |
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
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.DelimitedBuilder<T> |
delimited()
Returns an instance of a
FlatFileItemWriterBuilder.DelimitedBuilder for building a
DelimitedLineAggregator . |
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.FormattedBuilder<T> |
formatted()
Returns an instance of a
FlatFileItemWriterBuilder.FormattedBuilder for building a
FormatterLineAggregator . |
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 provided 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.AbstractFileItemWriter.setResource(Resource)
public FlatFileItemWriterBuilder<T> forceSync(boolean forceSync)
forceSync
- value to set the flag toAbstractFileItemWriter.setForceSync(boolean)
public FlatFileItemWriterBuilder<T> lineSeparator(java.lang.String lineSeparator)
lineSeparator
- value to use for a line separatorAbstractFileItemWriter.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.AbstractFileItemWriter.setEncoding(String)
public FlatFileItemWriterBuilder<T> shouldDeleteIfEmpty(boolean shouldDelete)
shouldDelete
- defaults to falseAbstractFileItemWriter.setShouldDeleteIfEmpty(boolean)
public FlatFileItemWriterBuilder<T> shouldDeleteIfExists(boolean shouldDelete)
shouldDelete
- defaults to trueAbstractFileItemWriter.setShouldDeleteIfExists(boolean)
public FlatFileItemWriterBuilder<T> append(boolean append)
append
- defaults to falseAbstractFileItemWriter.setAppendAllowed(boolean)
public FlatFileItemWriterBuilder<T> headerCallback(FlatFileHeaderCallback callback)
callback
- FlatFileHeaderCallback
implAbstractFileItemWriter.setHeaderCallback(FlatFileHeaderCallback)
public FlatFileItemWriterBuilder<T> footerCallback(FlatFileFooterCallback callback)
callback
- FlatFileFooterCallback
implAbstractFileItemWriter.setFooterCallback(FlatFileFooterCallback)
public FlatFileItemWriterBuilder<T> transactional(boolean transactional)
transactional
- defaults to trueAbstractFileItemWriter.setTransactional(boolean)
public FlatFileItemWriterBuilder.DelimitedBuilder<T> delimited()
FlatFileItemWriterBuilder.DelimitedBuilder
for building a
DelimitedLineAggregator
. The DelimitedLineAggregator
configured by
this builder will only be used if one is not explicitly configured via
lineAggregator
FlatFileItemWriterBuilder.DelimitedBuilder
public FlatFileItemWriterBuilder.FormattedBuilder<T> formatted()
FlatFileItemWriterBuilder.FormattedBuilder
for building a
FormatterLineAggregator
. The FormatterLineAggregator
configured by
this builder will only be used if one is not explicitly configured via
lineAggregator
FlatFileItemWriterBuilder.FormattedBuilder
public FlatFileItemWriter<T> build()
FlatFileItemWriter
.FlatFileItemWriter