Class AbstractItemWriter

  • All Implemented Interfaces:
    ItemWriter


    public abstract class AbstractItemWriter
    extends java.lang.Object
    implements ItemWriter
    The AbstractItemWriter provides default implementations of not commonly implemented methods.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Serializable checkpointInfo​()
      Override this method if the ItemWriter supports checkpoints.
      void close​()
      Override this method if the ItemWriter requires any close time processing.
      void open​(java.io.Serializable checkpoint)
      Override this method if the ItemWriter requires any open time processing.
      abstract void writeItems​(java.util.List<java.lang.Object> items)
      Implement write logic for the ItemWriter in this method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractItemWriter

        public AbstractItemWriter​()
    • Method Detail

      • open

        public void open​(java.io.Serializable checkpoint)
                  throws java.lang.Exception
        Override this method if the ItemWriter requires any open time processing. The default implementation does nothing.
        Specified by:
        open in interface ItemWriter
        Parameters:
        checkpoint - last checkpoint for this ItemReader
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.
      • close

        public void close​()
                   throws java.lang.Exception
        Override this method if the ItemWriter requires any close time processing. The default implementation does nothing.
        Specified by:
        close in interface ItemWriter
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.
      • writeItems

        public abstract void writeItems​(java.util.List<java.lang.Object> items)
                                 throws java.lang.Exception
        Implement write logic for the ItemWriter in this method.
        Specified by:
        writeItems in interface ItemWriter
        Parameters:
        items - specifies the list of items to write.
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.
      • checkpointInfo

        public java.io.Serializable checkpointInfo​()
                                            throws java.lang.Exception
        Override this method if the ItemWriter supports checkpoints. The default implementation returns null.
        Specified by:
        checkpointInfo in interface ItemWriter
        Returns:
        checkpoint data
        Throws:
        java.lang.Exception - (or subclass) if an error occurs.