T
- type of objects to write as Json output.public class JsonFileItemWriterBuilder<T>
extends java.lang.Object
JsonFileItemWriter
.Constructor and Description |
---|
JsonFileItemWriterBuilder() |
Modifier and Type | Method and Description |
---|---|
JsonFileItemWriterBuilder<T> |
append(boolean append)
If set to true and the file exists, the output will be appended to the existing
file.
|
JsonFileItemWriter<T> |
build()
Validate the configuration and build a new
JsonFileItemWriter . |
JsonFileItemWriterBuilder<T> |
encoding(java.lang.String encoding)
Encoding used for output.
|
JsonFileItemWriterBuilder<T> |
footerCallback(FlatFileFooterCallback callback)
A callback for footer processing.
|
JsonFileItemWriterBuilder<T> |
forceSync(boolean forceSync)
A flag indicating that changes should be force-synced to disk on flush.
|
JsonFileItemWriterBuilder<T> |
headerCallback(FlatFileHeaderCallback callback)
A callback for header processing.
|
JsonFileItemWriterBuilder<T> |
jsonObjectMarshaller(JsonObjectMarshaller<T> jsonObjectMarshaller)
Set the
JsonObjectMarshaller to use to marshal objects to json. |
JsonFileItemWriterBuilder<T> |
lineSeparator(java.lang.String lineSeparator)
String used to separate lines in output.
|
JsonFileItemWriterBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
JsonFileItemWriterBuilder<T> |
resource(org.springframework.core.io.Resource resource)
The
Resource to be used as output. |
JsonFileItemWriterBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
JsonFileItemWriterBuilder<T> |
shouldDeleteIfEmpty(boolean shouldDelete)
If set to true, once the step is complete, if the resource previously provided is
empty, it will be deleted.
|
JsonFileItemWriterBuilder<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.
|
JsonFileItemWriterBuilder<T> |
transactional(boolean transactional)
If set to true, the flushing of the buffer is delayed while a transaction is active.
|
public JsonFileItemWriterBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic JsonFileItemWriterBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public JsonFileItemWriterBuilder<T> forceSync(boolean forceSync)
forceSync
- value to set the flag toAbstractFileItemWriter.setForceSync(boolean)
public JsonFileItemWriterBuilder<T> lineSeparator(java.lang.String lineSeparator)
line.separator
.lineSeparator
- value to use for a line separatorAbstractFileItemWriter.setLineSeparator(String)
public JsonFileItemWriterBuilder<T> jsonObjectMarshaller(JsonObjectMarshaller<T> jsonObjectMarshaller)
JsonObjectMarshaller
to use to marshal objects to json.jsonObjectMarshaller
- to useJsonFileItemWriter.setJsonObjectMarshaller(JsonObjectMarshaller)
public JsonFileItemWriterBuilder<T> resource(org.springframework.core.io.Resource resource)
Resource
to be used as output.resource
- the output of the writer.AbstractFileItemWriter.setResource(Resource)
public JsonFileItemWriterBuilder<T> encoding(java.lang.String encoding)
encoding
- encoding type.AbstractFileItemWriter.setEncoding(String)
public JsonFileItemWriterBuilder<T> shouldDeleteIfEmpty(boolean shouldDelete)
shouldDelete
- defaults to falseAbstractFileItemWriter.setShouldDeleteIfEmpty(boolean)
public JsonFileItemWriterBuilder<T> shouldDeleteIfExists(boolean shouldDelete)
shouldDelete
- defaults to trueAbstractFileItemWriter.setShouldDeleteIfExists(boolean)
public JsonFileItemWriterBuilder<T> append(boolean append)
append
- defaults to falseAbstractFileItemWriter.setAppendAllowed(boolean)
public JsonFileItemWriterBuilder<T> headerCallback(FlatFileHeaderCallback callback)
callback
- FlatFileHeaderCallback
implementationAbstractFileItemWriter.setHeaderCallback(FlatFileHeaderCallback)
public JsonFileItemWriterBuilder<T> footerCallback(FlatFileFooterCallback callback)
callback
- FlatFileFooterCallback
implementationAbstractFileItemWriter.setFooterCallback(FlatFileFooterCallback)
public JsonFileItemWriterBuilder<T> transactional(boolean transactional)
transactional
- defaults to trueAbstractFileItemWriter.setTransactional(boolean)
public JsonFileItemWriter<T> build()
JsonFileItemWriter
.JsonFileItemWriter