クラス ResourcesItemReader
java.lang.ObjectSE
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.item.support.AbstractItemStreamItemReader<org.springframework.core.io.Resource>
org.springframework.batch.item.file.ResourcesItemReader
- 実装されているすべてのインターフェース:
ItemReader<org.springframework.core.io.Resource>、ItemStream、ItemStreamReader<org.springframework.core.io.Resource>
public class ResourcesItemReader
extends AbstractItemStreamItemReader<org.springframework.core.io.Resource>
配列から
Resource インスタンスを生成する ItemReader。これは、パターン(mydir/*.txt など)を挿入する構成エントリで便利に使用でき、Spring は ApplicationContext によってリソースの配列に変換できます。open(ExecutionContext) の呼び出し間のスレッドセーフ。ExecutionContext はマルチスレッド環境では正確ではないため、再起動をそのデータに依存しないでください(つまり、常に新しいコンテキストで開いてください)。- 導入:
- 2.1
- 作成者:
- Dave Syer, Mahmoud Ben Hassine
- 関連事項:
ResourceArrayPropertyEditor
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidopen(ExecutionContext executionContext) ノーオペレーション。org.springframework.core.io.Resourceread()カウンターをインクリメントし、入力から次のResourceインスタンスを返すか、何も残っていない場合はnullを返します。voidsetResources(org.springframework.core.io.Resource[] resources) アイテムとして機能するリソース。voidupdate(ExecutionContext executionContext) 空のExecutionContextを返します。クラス org.springframework.batch.item.ItemStreamSupport から継承されたメソッド
close, getExecutionContextKey, getName, setExecutionContextName, setNameクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.batch.item.ItemStream から継承されたメソッド
close
コンストラクターの詳細
ResourcesItemReader
public ResourcesItemReader()
メソッドの詳細
setResources
public void setResources(org.springframework.core.io.Resource[] resources) アイテムとして機能するリソース。ヒント: パターンを使用して構成します。- パラメーター:
resources- リソース
read
カウンターをインクリメントし、入力から次のResourceインスタンスを返すか、何も残っていない場合はnullを返します。- 戻り値:
- T 処理するアイテム、またはデータソースが使い果たされた場合は
null - 例外:
ParseException- 現在のレコードの解析に問題がある場合 (しかし、次のものはまだ有効かもしれません)NonTransientResourceException- 基礎となるリソースに致命的な例外がある場合。この例外をスローした後、実装は後続の read 呼び出しから null を返すように努める必要があります。UnexpectedInputException- 入力データに未分類の問題がある場合。潜在的に一時的であると想定します。後続の読み取り呼び出しは成功する可能性があります。ExceptionSE- 特定のエラーがない場合。
open
クラスからコピーされた説明:ItemStreamSupportノーオペレーション。- 次で指定:
- インターフェース
ItemStreamのopen - オーバーライド:
- クラス
ItemStreamSupportのopen - パラメーター:
executionContext- 現在のステップのExecutionContext。再起動時のステップの最後の実行からの executionContext になります。- 例外:
ItemStreamException- 関連事項:
update
クラスからコピーされた説明:ItemStreamSupport空のExecutionContextを返します。- 次で指定:
- インターフェース
ItemStreamのupdate - オーバーライド:
- クラス
ItemStreamSupportのupdate - パラメーター:
executionContext- 更新される- 例外:
ItemStreamException- 関連事項: