An implementation of
javax.batch.api.chunk.ItemReader
that reads from an array
of data. The input
ItemReaderWriterBase.resource
may be specified as a url or path to external resource,
or an inlined content. In either case, the array resource content should be enclosed
inside
[]
. For example,
<property name="resource" value='["a", "b", "c"]'/>
<property name="resource" value="[1, 2, 3]"/>
<property name="beanType" value="java.lang.Integer"/>
<property name="resource" value="movies-2012.json"/>
<property name="beanType" value="org.jberet.support.io.Movie"/>
<property name="beanType" value="org.jberet.support.io.Movie"/>
<property name="resource" value='[
{"rank" : 1, "tit" : "Number One", "grs" : 1000, "opn" : "2017-01-01"},
{"rank" : 2, "tit" : "Number Two", "grs" : 2000, "opn" : "2017-02-02"},
{"rank" : 3, "tit" : "Number Three", "grs" : 3000, "opn" : "2017-03-03"},
{"rank" : 4, "tit" : "Number Four", "grs" : 4000, "opn" : "2017-04-04"},
{"rank" : 5, "tit" : "Number Five", "grs" : 5000, "opn" : "2017-05-05"}
]'/>
The default data type is
String
, and
JsonItemReader.beanType
batch property
can be used to specify the intended data type, which can be
String
,
any primitive wrapper type, or custom POJO.