Package org.springframework.batch.core

# Interface ItemReadListener<T>

All Superinterfaces:
  `StepListener`

All Known Implementing Classes:
  `CompositeItemReadListener`, `DefaultItemFailureHandler`, `ItemListenerSupport`, `MulticasterBatchListener`, `StepListenerSupport`

public interface ItemReadListener<T> extends StepListener
Listener interface around the reading of an item.

Author:
  Lucas Ward, Mahmoud Ben Hassine

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `afterRead(T item)`
  Called after `ItemReader.read()`.
  `default void`
  `beforeRead()`
  Called before `ItemReader.read()`
  `default void`
  `onReadError(Exception ex)`
  Called if an error occurs while trying to read.

- ## Method Details

  - ### beforeRead

    default void beforeRead()
    Called before `ItemReader.read()`

  - ### afterRead

    default void afterRead(T item)
    Called after `ItemReader.read()`. This method is called only for actual items (ie it is not called when the reader returns null).
    Parameters:
      `item` - returned from read()

  - ### onReadError

    default void onReadError(Exception ex)
    Called if an error occurs while trying to read.
    Parameters:
      `ex` - thrown from `ItemReader`