クラス 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>ItemStreamItemStreamReader<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
  • コンストラクターの詳細

    • ResourcesItemReader

      public ResourcesItemReader()
  • メソッドの詳細

    • setResources

      public void setResources(org.springframework.core.io.Resource[] resources)
      アイテムとして機能するリソース。ヒント: パターンを使用して構成します。
      パラメーター:
      resources - リソース
    • read

      @Nullable public org.springframework.core.io.Resource read() throws ExceptionSE
      カウンターをインクリメントし、入力から次の Resource インスタンスを返すか、何も残っていない場合は null を返します。
      戻り値:
      T 処理するアイテム、またはデータソースが使い果たされた場合は null 
      例外:
      ParseException - 現在のレコードの解析に問題がある場合 (しかし、次のものはまだ有効かもしれません)
      NonTransientResourceException - 基礎となるリソースに致命的な例外がある場合。この例外をスローした後、実装は後続の read 呼び出しから null を返すように努める必要があります。
      UnexpectedInputException - 入力データに未分類の問題がある場合。潜在的に一時的であると想定します。後続の読み取り呼び出しは成功する可能性があります。
      ExceptionSE - 特定のエラーがない場合。
    • open

      public void open(ExecutionContext executionContext) throws ItemStreamException
      クラスからコピーされた説明: ItemStreamSupport
      ノーオペレーション。
      次で指定:
      インターフェース ItemStreamopen 
      オーバーライド:
      クラス ItemStreamSupportopen 
      パラメーター:
      executionContext - 現在のステップの ExecutionContext 再起動時のステップの最後の実行からの executionContext になります。
      例外:
      ItemStreamException
      関連事項:
    • update

      public void update(ExecutionContext executionContext) throws ItemStreamException
      クラスからコピーされた説明: ItemStreamSupport
      空の ExecutionContext を返します。
      次で指定:
      インターフェース ItemStreamupdate 
      オーバーライド:
      クラス ItemStreamSupportupdate 
      パラメーター:
      executionContext - 更新される
      例外:
      ItemStreamException
      関連事項: