T
- type of the target itempublic class JsonItemReaderBuilder<T>
extends java.lang.Object
JsonItemReader
.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
JsonItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
JsonItemReader<T> |
build()
Validate the configuration and build a new
JsonItemReader . |
JsonItemReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
JsonItemReaderBuilder<T> |
jsonObjectReader(JsonObjectReader<T> jsonObjectReader)
Set the
JsonObjectReader to use to read and map Json objects to domain objects. |
JsonItemReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
JsonItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
JsonItemReaderBuilder<T> |
resource(org.springframework.core.io.Resource resource)
The
Resource to be used as input. |
JsonItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
JsonItemReaderBuilder<T> |
strict(boolean strict)
Setting this value to true indicates that it is an error if the input
does not exist and an exception will be thrown.
|
public JsonItemReaderBuilder<T> jsonObjectReader(JsonObjectReader<T> jsonObjectReader)
JsonObjectReader
to use to read and map Json objects to domain objects.jsonObjectReader
- to useJsonItemReader.setJsonObjectReader(JsonObjectReader)
public JsonItemReaderBuilder<T> resource(org.springframework.core.io.Resource resource)
Resource
to be used as input.resource
- the input to the reader.JsonItemReader.setResource(Resource)
public JsonItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public JsonItemReaderBuilder<T> strict(boolean strict)
strict
- indicates the input resource must existJsonItemReader.setStrict(boolean)
public JsonItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic JsonItemReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public JsonItemReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public JsonItemReader<T> build()
JsonItemReader
.JsonItemReader