javax.batch.api.chunk.listener

## Class AbstractItemReadListener

- java.lang.Object
- - javax.batch.api.chunk.listener.AbstractItemReadListener

All Implemented Interfaces:
  ItemReadListener

    public abstract class AbstractItemReadListener
    extends Object
    implements ItemReadListener

The AbstractItemReadListener provides default implementations of less commonly implemented methods.

### Constructor Summary

Constructors
Constructor and Description
`AbstractItemReadListener()`

### Method Summary

Methods
`void` `afterRead(Object item)` Override this method if the ItemReadListener will do something after the item is read.
`void` `beforeRead()` Override this method if the ItemReadListener will do something before the item is read.
`void` `onReadError(Exception ex)` Override this method if the ItemReadListener will do something when the ItemReader readItem method throws an exception.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AbstractItemReadListener

    public AbstractItemReadListener()

### Method Detail

#### beforeRead

    public void beforeRead()
                    throws Exception

Override this method if the ItemReadListener will do something before the item is read. The default implementation does nothing.

Specified by:
  `beforeRead` in interface `ItemReadListener`
Throws:
  `Exception` - (or subclass) if an error occurs.

#### afterRead

    public void afterRead(Object item)
                   throws Exception

Override this method if the ItemReadListener will do something after the item is read. The default implementation does nothing.

Specified by:
  `afterRead` in interface `ItemReadListener`
Parameters:
  `item` - last item read by ItemReader
Throws:
  `Exception` - (or subclass) if an error occurs.

#### onReadError

    public void onReadError(Exception ex)
                     throws Exception

Override this method if the ItemReadListener will do something when the ItemReader readItem method throws an exception. The default implementation does nothing.

Specified by:
  `onReadError` in interface `ItemReadListener`
Parameters:
  `ex` - exception thrown from readItem method
Throws:
  `Exception` - (or subclass) if an error occurs.

© Copyright IBM Corp. 2014
Licensed under the Apache License, Version 2.0