Class AbstractObjectProcessor<T extends Context>
- All Implemented Interfaces:
ConversionProcessor, Processor<T>
- Direct Known Subclasses:
AbstractBatchedObjectColumnProcessor, AbstractMasterDetailProcessor, AbstractObjectColumnProcessor, AbstractObjectListProcessor, ObjectRowProcessor
Processor implementation for converting rows extracted from any implementation of AbstractParser into arrays of objects.
This uses the value conversions provided by Conversion instances.
For each row processed, a sequence of conversions will be executed and stored in an object array, at its original position.
The row with the result of these conversions will then be sent to the rowProcessed(Object[], Context) method, where the user can access it.
- Author:
- Univocity Software Pty Ltd - parsers@univocity.com
- See Also:
-
Field Summary
Fields inherited from class DefaultConversionProcessor
conversions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessEnded(T context) This method will by invoked by the parser once, after the parsing process stopped and all resources were closed.voidprocessStarted(T context) This method will by invoked by the parser once, when it is ready to start processing the input.abstract voidrowProcessed(Object[] row, T context) Invoked by the processor after all values of a valid record have been processed and converted into an Object array.voidrowProcessed(String[] row, T context) Executes the sequences of conversions defined usingDefaultConversionProcessor.convertFields(Conversion...),DefaultConversionProcessor.convertIndexes(Conversion...)andDefaultConversionProcessor.convertAll(Conversion...), for every field in the given row.Methods inherited from class DefaultConversionProcessor
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingException
-
Constructor Details
-
AbstractObjectProcessor
public AbstractObjectProcessor()
-
-
Method Details
-
rowProcessed
Executes the sequences of conversions defined usingDefaultConversionProcessor.convertFields(Conversion...),DefaultConversionProcessor.convertIndexes(Conversion...)andDefaultConversionProcessor.convertAll(Conversion...), for every field in the given row.Each field will be transformed using the
Conversion.execute(Object)method.In general the conversions will process a String and convert it to some object value (such as booleans, dates, etc).
- Specified by:
rowProcessedin interfaceProcessor<T extends Context>- Parameters:
row- the parsed record with its individual records as extracted from the original input.context- the current state of the parsing process.Fields that do not have any conversion defined will just be copied to the object array into their original positions.
-
rowProcessed
Invoked by the processor after all values of a valid record have been processed and converted into an Object array.- Parameters:
row- object array created with the information extracted by the parser and then converted.context- A contextual object with information and controls over the current state of the parsing process
-
processStarted
Description copied from interface:ProcessorThis method will by invoked by the parser once, when it is ready to start processing the input.- Specified by:
processStartedin interfaceProcessor<T extends Context>- Parameters:
context- A contextual object with information and controls over the current state of the parsing process
-
processEnded
Description copied from interface:ProcessorThis method will by invoked by the parser once, 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<T extends Context>- Parameters:
context- A contextual object with information and controls over the state of the parsing process
-