Top Description Methods
com.univocity.parsers.common.processor

public Interface RowProcessor

extends Processor<ParsingContext>
Known Direct Implementers
com.univocity.parsers.common.processor.RowProcessorSwitch, com.univocity.parsers.common.processor.AbstractRowProcessor, com.univocity.parsers.common.processor.BatchedColumnProcessor, com.univocity.parsers.common.processor.BatchedObjectColumnProcessor, com.univocity.parsers.common.processor.BeanListProcessor, com.univocity.parsers.common.processor.BeanProcessor, com.univocity.parsers.common.processor.ColumnProcessor, com.univocity.parsers.common.processor.CompositeRowProcessor, com.univocity.parsers.common.processor.ConcurrentRowProcessor, com.univocity.parsers.common.processor.InputValueSwitch, com.univocity.parsers.common.processor.MasterDetailListProcessor, com.univocity.parsers.common.processor.MultiBeanListProcessor, com.univocity.parsers.common.processor.MultiBeanProcessor, com.univocity.parsers.common.processor.MultiBeanRowProcessor, com.univocity.parsers.common.processor.ObjectColumnProcessor, com.univocity.parsers.common.processor.ObjectRowListProcessor, com.univocity.parsers.common.processor.ObjectRowProcessor, com.univocity.parsers.common.processor.RowListProcessor
Imports
com.univocity.parsers.common.*, com.univocity.parsers.common.processor.core.*, com.univocity.parsers.conversions.*

The essential callback interface to handle records parsed by any parser that extends AbstractParser.

When parsing an input, univocity-parsers will obtain the RowProcessor from CommonParserSettings#getRowProcessor(), and delegate each parsed row to RowProcessor#rowProcessed(String[], ParsingContext).

Before parsing the first row, the parser will invoke the RowProcessor#processStarted(ParsingContext) method. By this time the input buffer will be already loaded and ready to be consumed.

After parsing the last row, all resources are closed and the processing stops. Only after the RowProcessor#processEnded(ParsingContext) is called so you can perform any additional housekeeping you might need.

More control and information over the parsing process are provided by the ParsingContext object.

univocity-parsers provides many useful default implementations of this interface in the package com.univocity.parsers.common.processor, namely:

Author
Univocity Software Pty Ltd - [email protected]
See Also
com.univocity.parsers.common.AbstractParser, com.univocity.parsers.common.CommonParserSettings, com.univocity.parsers.common.ParsingContext

Method Summary

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

Redeclares 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(ParsingContext
A contextual object with information and controls over the current state of the parsing process
context
)

Redeclares 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 data extracted by the parser for an individual record. Note that:
row
,
ParsingContext
A contextual object with information and controls over the current state of the parsing process
context
)

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

Invoked by the parser after all values of a valid record have been processed.

Method Detail

processEndedback to summary
public void processEnded(ParsingContext context)

Redeclares 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:ParsingContext

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

processStartedback to summary
public void processStarted(ParsingContext context)

Redeclares 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:ParsingContext

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

rowProcessedback to summary
public void rowProcessed(String[] row, ParsingContext context)

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

Invoked by the parser after all values of a valid record have been processed.

Parameters
row:String[]

the data extracted by the parser for an individual record. Note that:

context:ParsingContext

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