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