T
- 読み取る json オブジェクトの型 public class JsonItemReader<T> extends AbstractItemCountingItemStreamItemReader<T> implements ResourceAwareItemReaderItemStream<T>
Resource
から Json オブジェクトを読み取る ItemStreamReader
実装: [ { // JSON object }, { // JSON object } ]
実装はスレッドセーフではありません。
コンストラクターと説明 |
---|
JsonItemReader() 新しい JsonItemReader インスタンスを作成します。 |
JsonItemReader(org.springframework.core.io.Resource resource, JsonObjectReader<T> jsonObjectReader) 新しい JsonItemReader インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected void | doClose() AbstractItemCountingItemStreamItemReader.doOpen() で開いたリソースを閉じます。 |
protected void | doOpen() 入力の読み取りを開始するために必要なリソースを開きます。 |
protected T | doRead() 入力から次の項目を読み取ります。 |
void | setJsonObjectReader(JsonObjectReader<T> jsonObjectReader) JZon フラグメントの読み取りとドメインオブジェクトへのマッピングに使用する JsonObjectReader を設定します。 |
void | setResource(org.springframework.core.io.Resource resource) |
void | setStrict(boolean strict) 厳格モードでは、入力リソースが存在しない場合、リーダーは AbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext) で例外をスローします。 |
close, getCurrentItemCount, isSaveState, jumpToItem, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, update
getExecutionContextKey, setExecutionContextName, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, open, update
read
public JsonItemReader(org.springframework.core.io.Resource resource, JsonObjectReader<T> jsonObjectReader)
JsonItemReader
インスタンスを作成します。resource
- 入力 json リソース jsonObjectReader
- 使用する json オブジェクトリーダー public JsonItemReader()
JsonItemReader
インスタンスを作成します。public void setJsonObjectReader(JsonObjectReader<T> jsonObjectReader)
JsonObjectReader
を設定します。jsonObjectReader
- 使用する json オブジェクトリーダー public void setStrict(boolean strict)
AbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext)
で例外をスローします。strict
- デフォルトで truepublic void setResource(org.springframework.core.io.Resource resource)
ResourceAwareItemReaderItemStream<T>
の setResource
@Nullable protected T doRead() throws java.lang.Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader<T>
の doRead
null
java.lang.Exception
- サブクラスがフレームワークによる解釈のためにチェック済み例外をスローできるようにします protected void doOpen() throws java.lang.Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader<T>
の doOpen
java.lang.Exception
- サブクラスがフレームワークによる解釈のためにチェック済み例外をスローできるようにします protected void doClose() throws java.lang.Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader.doOpen()
で開いたリソースを閉じます。AbstractItemCountingItemStreamItemReader<T>
の doClose
java.lang.Exception
- サブクラスがフレームワークによる解釈のためにチェック済み例外をスローできるようにします