Class CompositeProcessor<C extends Context>
- java.lang.Object
-
- com.univocity.parsers.common.processor.core.CompositeProcessor<C>
-
- Type Parameters:
C- the tye of the contextual object with information and controls over the current state of the parsing process
- All Implemented Interfaces:
Processor<C>
- Direct Known Subclasses:
CompositeRowProcessor
public class CompositeProcessor<C extends Context> extends java.lang.Object implements Processor<C>
-
-
Field Summary
Fields Modifier and Type Field Description private Processor[]processors
-
Constructor Summary
Constructors Constructor Description CompositeProcessor(Processor... processors)Creates a newCompositeProcessorwith the list ofProcessorimplementations to be used.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocessEnded(C context)This method will by invoked by the parser once for eachProcessorused by this class, after the parsing process stopped and all resources were closed.voidprocessStarted(C context)Initializes eachProcessorused by this class.voidrowProcessed(java.lang.String[] row, C context)Invoked by the parser after all values of a valid record have been processed.
-
-
-
Field Detail
-
processors
private final Processor[] processors
-
-
Method Detail
-
processStarted
public void processStarted(C context)
Initializes eachProcessorused by this class. This is invoked by the parser once, when it is ready to start processing the input.- Specified by:
processStartedin interfaceProcessor<C extends Context>- Parameters:
context- A contextual object with information and controls over the current state of the parsing process
-
rowProcessed
public void rowProcessed(java.lang.String[] row, C context)Invoked by the parser after all values of a valid record have been processed. AllProcessorimplementations will have their correspondingProcessor.rowProcessed(String[], Context)method called with the given row.- Specified by:
rowProcessedin interfaceProcessor<C extends Context>- Parameters:
row- the data extracted by the parser for an individual record. Note that:- it will never by null.
- it will never be empty unless explicitly configured using
CommonSettings.setSkipEmptyLines(boolean) - it won't contain lines identified by the parser as comments. To disable comment processing set
Format.setComment(char)to '\0'
context- A contextual object with information and controls over the current state of the parsing process
-
processEnded
public void processEnded(C context)
This method will by invoked by the parser once for eachProcessorused by this class, after the parsing process stopped and all resources were closed.It will always be called by the parser: in case of errors, if the end of the input us reached, or if the user stopped the process manually using
Context.stop().- Specified by:
processEndedin interfaceProcessor<C extends Context>- Parameters:
context- A contextual object with information and controls over the state of the parsing process
-
-