クラス JsonItemReader<T>
java.lang.ObjectSE
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.item.support.AbstractItemStreamItemReader<T>
org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>
org.springframework.batch.item.json.JsonItemReader<T>
- 型パラメーター:
T
- 読み取る json オブジェクトの型
- 実装されたすべてのインターフェース:
ResourceAwareItemReaderItemStream<T>
、ItemReader<T>
、ItemStream
、ItemStreamReader<T>
public class JsonItemReader<T>
extends AbstractItemCountingItemStreamItemReader<T>
implements ResourceAwareItemReaderItemStream<T>
次の形式の
Resource
から Json オブジェクトを読み取る ItemStreamReader
実装: [ { // JSON object }, { // JSON object } ]
実装はスレッドセーフではありません。
- 導入:
- 4.1
- 作成者:
- Mahmoud Ben Hassine
コンストラクターのサマリー
コンストラクター説明新しい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)
で例外をスローします。クラス org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader から継承されたメソッド
close, getCurrentItemCount, isSaveState, jumpToItem, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, update
クラス org.springframework.batch.item.ItemStreamSupport から継承されたメソッド
getExecutionContextKey, getName, setExecutionContextName, setName
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.batch.item.ItemReader から継承されたメソッド
read
インターフェース org.springframework.batch.item.ItemStream から継承されたメソッド
close, open, update
コンストラクターの詳細
JsonItemReader
public JsonItemReader(org.springframework.core.io.Resource resource, JsonObjectReader<T> jsonObjectReader) 新しいJsonItemReader
インスタンスを作成します。- パラメーター:
resource
- 入力 json リソースjsonObjectReader
- 使用する json オブジェクトリーダー
JsonItemReader
public JsonItemReader()新しいJsonItemReader
インスタンスを作成します。
メソッドの詳細
setJsonObjectReader
JZon フラグメントの読み取りとドメインオブジェクトへのマッピングに使用するJsonObjectReader
を設定します。- パラメーター:
jsonObjectReader
- 使用する json オブジェクトリーダー
setStrict
public void setStrict(boolean strict) 厳格モードでは、入力リソースが存在しない場合、リーダーはAbstractItemCountingItemStreamItemReader.open(org.springframework.batch.item.ExecutionContext)
で例外をスローします。- パラメーター:
strict
- デフォルトで true
setResource
public void setResource(org.springframework.core.io.Resource resource) - 次で指定:
- インターフェース
ResourceAwareItemReaderItemStream<T>
のsetResource
doRead
クラスからコピーされた説明:AbstractItemCountingItemStreamItemReader
入力から次の項目を読み取ります。- 次で指定:
- クラス
AbstractItemCountingItemStreamItemReader<T>
のdoRead
- 戻り値:
- データソースが使い果たされた場合、アイテムまたは
null
- 例外:
ExceptionSE
- サブクラスがフレームワークによる解釈のためにチェック済み例外をスローできるようにします
doOpen
クラスからコピーされた説明:AbstractItemCountingItemStreamItemReader
入力の読み取りを開始するために必要なリソースを開きます。- 次で指定:
- クラス
AbstractItemCountingItemStreamItemReader<T>
のdoOpen
- 例外:
ExceptionSE
- サブクラスがフレームワークによる解釈のためにチェック済み例外をスローできるようにします
doClose
クラスからコピーされた説明:AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader.doOpen()
で開いたリソースを閉じます。- 次で指定:
- クラス
AbstractItemCountingItemStreamItemReader<T>
のdoClose
- 例外:
ExceptionSE
- サブクラスがフレームワークによる解釈のためにチェック済み例外をスローできるようにします