Package de.hybris.platform.impex.jalo
Class ReaderManager
java.lang.Object
de.hybris.platform.impex.jalo.ReaderManager
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
ConstructorsConstructorDescriptionReaderManager(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
Modifier and TypeMethodDescriptionvoidclear()Clears the stack by callingpopReader()for each reader at stack (includes closing of reader).intGets the column offset configured for current reader instance.Gets the location of the current reading process by concatenating all locations of the reader at stack.Gets the main reader (reader given at constructor).Gets the current reader instance.Closes, removes and returns current reader.voidpushReader(CSVReader reader, int columnOffset, String locationText) Pushes a reader at the reader stack, so it will be the current one.intGets the count of reader managed by this instance.
-
Constructor Details
-
ReaderManager
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 Details
-
pushReader
Pushes a reader at the reader stack, so it will be the current one.- Parameters:
reader- new reader instancecolumnOffset- column offset used when reading with given readerlocationText- location text used for logging of reader
-
popReader
Closes, removes and returns current reader.- Returns:
- current reader removed from stack or null if no reader is registered
-
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 callingpopReader()for each reader at stack (includes closing of reader). -
peekReader
Gets the current reader instance.- Returns:
- current reader
-
getMainReader
Gets the main reader (reader given at constructor).- Returns:
- main reader
-
getCurrentColumnOffset
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
-