Top Description Fields Constructors Methods
com.univocity.parsers.common.processor.core

public abstract Class AbstractObjectProcessor<T extends Context>

extends DefaultConversionProcessor
implements Processor<T extends Context>
Class Inheritance
All Implemented Interfaces
com.univocity.parsers.common.processor.core.Processor
Known Direct Subclasses
com.univocity.parsers.common.processor.ObjectRowProcessor, com.univocity.parsers.common.processor.core.AbstractBatchedObjectColumnProcessor, com.univocity.parsers.common.processor.core.AbstractMasterDetailProcessor, com.univocity.parsers.common.processor.core.AbstractObjectColumnProcessor, com.univocity.parsers.common.processor.core.AbstractObjectListProcessor
Imports
com.univocity.parsers.common.*, com.univocity.parsers.conversions.*

A 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 AbstractObjectProcessor#rowProcessed(Object[], Context) method, where the user can access it.

Author
Univocity Software Pty Ltd - [email protected]
See Also
AbstractParser, Processor

Field Summary

Inherited from com.univocity.parsers.common.DefaultConversionProcessor:
conversions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
processEnded(T
A contextual object with information and controls over the state of the parsing process
context
)

Implements com.univocity.parsers.common.processor.core.Processor.processEnded.

This method will by invoked by the parser once, after the parsing process stopped and all resources were closed.
public void
processStarted(T
A contextual object with information and controls over the current state of the parsing process
context
)

Implements com.univocity.parsers.common.processor.core.Processor.processStarted.

This method will by invoked by the parser once, when it is ready to start processing the input.
public void
rowProcessed(String[]
the parsed record with its individual records as extracted from the original input.
row
,
T
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.

context
)

Implements com.univocity.parsers.common.processor.core.Processor.rowProcessed.

Executes the sequences of conversions defined using DefaultConversionProcessor#convertFields(Conversion...), DefaultConversionProcessor#convertIndexes(Conversion...) and DefaultConversionProcessor#convertAll(Conversion...), for every field in the given row.
public abstract void
rowProcessed(Object[]
object array created with the information extracted by the parser and then converted.
row
,
T
A contextual object with information and controls over the current state of the parsing process
context
)

Invoked by the processor after all values of a valid record have been processed and converted into an Object array.

Inherited from com.univocity.parsers.common.DefaultConversionProcessor:
applyConversionsconvertAllconvertFieldsconvertIndexesconvertTypehandleConversionErrorinitializeConversionsreverseConversionstoDataProcessingException

Constructor Detail

AbstractObjectProcessorback to summary
public AbstractObjectProcessor()

Method Detail

processEndedback to summary
public void processEnded(T context)

Implements com.univocity.parsers.common.processor.core.Processor.processEnded.

Doc from com.univocity.parsers.common.processor.core.Processor.processEnded.

This 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 ParsingContext#stop().

Parameters
context:T

A contextual object with information and controls over the state of the parsing process

Annotations
@Override
processStartedback to summary
public void processStarted(T context)

Implements com.univocity.parsers.common.processor.core.Processor.processStarted.

Doc from com.univocity.parsers.common.processor.core.Processor.processStarted.

This method will by invoked by the parser once, when it is ready to start processing the input.

Parameters
context:T

A contextual object with information and controls over the current state of the parsing process

Annotations
@Override
rowProcessedback to summary
public void rowProcessed(String[] row, T context)

Implements com.univocity.parsers.common.processor.core.Processor.rowProcessed.

Executes the sequences of conversions defined using DefaultConversionProcessor#convertFields(Conversion...), DefaultConversionProcessor#convertIndexes(Conversion...) and DefaultConversionProcessor#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).

Parameters
row:String[]

the parsed record with its individual records as extracted from the original input.

context:T

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.

Annotations
@Override
rowProcessedback to summary
public abstract void rowProcessed(Object[] row, T context)

Invoked by the processor after all values of a valid record have been processed and converted into an Object array.

Parameters
row:Object[]

object array created with the information extracted by the parser and then converted.

context:T

A contextual object with information and controls over the current state of the parsing process