Class ReaderManager


  • public class ReaderManager
    extends java.lang.Object
    Class holding a stack of CSVReader instances. The ImpExReader uses this class for managing its reader instances. The reader on top of the stack represents the current reader instance and the one at bottom the reader of the main script.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReaderManager​(CSVReader mainReader)
      Creates a new manager initialized with given reader, which represents the main reader and will be pushed to the bottom of the reader stack.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears the stack by calling popReader() for each reader at stack (includes closing of reader).
      int getCurrentColumnOffset()
      Gets the column offset configured for current reader instance.
      java.lang.String getCurrentLocation()
      Gets the location of the current reading process by concatenating all locations of the reader at stack.
      CSVReader getMainReader()
      Gets the main reader (reader given at constructor).
      CSVReader peekReader()
      Gets the current reader instance.
      CSVReader popReader()
      Closes, removes and returns current reader.
      void pushReader​(CSVReader reader, int columnOffset, java.lang.String locationText)
      Pushes a reader at the reader stack, so it will be the current one.
      int readerCount()
      Gets the count of reader managed by this instance.
      • Methods inherited from class java.lang.Object

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

      • ReaderManager

        public ReaderManager​(CSVReader mainReader)
        Creates a new manager initialized with given reader, which represents the main reader and will be pushed to the bottom of the reader stack.
        Parameters:
        mainReader - main reader
    • Method Detail

      • pushReader

        public void pushReader​(CSVReader reader,
                               int columnOffset,
                               java.lang.String locationText)
        Pushes a reader at the reader stack, so it will be the current one.
        Parameters:
        reader - new reader instance
        columnOffset - column offset used when reading with given reader
        locationText - location text used for logging of reader
      • popReader

        public CSVReader popReader()
        Closes, removes and returns current reader.
        Returns:
        current reader removed from stack or null if no reader is registered
      • getCurrentLocation

        public java.lang.String getCurrentLocation()
        Gets the location of the current reading process by concatenating all locations of the reader at stack.
        Returns:
        location of reading process
      • clear

        public void clear()
        Clears the stack by calling popReader() for each reader at stack (includes closing of reader).
      • peekReader

        public CSVReader peekReader()
        Gets the current reader instance.
        Returns:
        current reader
      • getMainReader

        public CSVReader getMainReader()
        Gets the main reader (reader given at constructor).
        Returns:
        main reader
      • getCurrentColumnOffset

        public int getCurrentColumnOffset()
                                   throws JaloSystemException
        Gets the column offset configured for current reader instance.
        Returns:
        column offset of current reader
        Throws:
        JaloSystemException - if no reader is registered
      • readerCount

        public int readerCount()
        Gets the count of reader managed by this instance.
        Returns:
        amount of readers