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

public Class InputValueSwitch

extends AbstractInputValueSwitch<ParsingContext>
implements RowProcessor
Class Inheritance
All Implemented Interfaces
com.univocity.parsers.common.processor.RowProcessor, com.univocity.parsers.common.processor.core.Processor
Imports
com.univocity.parsers.common.*, com.univocity.parsers.common.processor.core.*

A concrete implementation of RowProcessorSwitch that allows switching among different implementations of RowProcessor based on values found on the rows parsed from the input.

Constructor Summary

AccessConstructor and Description
public
InputValueSwitch()

Creates a switch that will analyze the first column of rows found in the input to determine which RowProcessor to use for each parsed row

public
InputValueSwitch(int
the column index whose value will be used to determine which RowProcessor to use for each parsed row.
columnIndex
)

Creates a switch that will analyze a column of rows parsed from the input to determine which RowProcessor to use.

public
InputValueSwitch(String
name of the column whose values will be used to determine which RowProcessor to use for each parsed row.
columnName
)

Creates a switch that will analyze a column in rows parsed from the input to determine which RowProcessor to use.

Method Summary

Modifier and TypeMethod and Description
protected final ParsingContext
wrapContext(ParsingContext
the context to wrap
context
)

Implements abstract com.univocity.parsers.common.processor.core.AbstractProcessorSwitch.wrapContext.

Wraps a given parser context object that returns headers and extracted field indexes associated with a given processor in this switch.
Inherited from com.univocity.parsers.common.processor.core.AbstractInputValueSwitch:
addSwitchForValueaddSwitchForValueaddSwitchForValueaddSwitchForValueaddSwitchForValueaddSwitchForValuegetHeadersgetIndexeshasDefaultSwitchsetCaseSensitivesetComparatorsetDefaultSwitchsetDefaultSwitchsetDefaultSwitchswitchRowProcessor

Constructor Detail

InputValueSwitchback to summary
public InputValueSwitch()

Creates a switch that will analyze the first column of rows found in the input to determine which RowProcessor to use for each parsed row

InputValueSwitchback to summary
public InputValueSwitch(int columnIndex)

Creates a switch that will analyze a column of rows parsed from the input to determine which RowProcessor to use.

Parameters
columnIndex:int

the column index whose value will be used to determine which RowProcessor to use for each parsed row.

InputValueSwitchback to summary
public InputValueSwitch(String columnName)

Creates a switch that will analyze a column in rows parsed from the input to determine which RowProcessor to use.

Parameters
columnName:String

name of the column whose values will be used to determine which RowProcessor to use for each parsed row.

Method Detail

wrapContextback to summary
protected final ParsingContext wrapContext(ParsingContext context)

Implements abstract com.univocity.parsers.common.processor.core.AbstractProcessorSwitch.wrapContext.

Doc from com.univocity.parsers.common.processor.core.AbstractProcessorSwitch.wrapContext.

Wraps a given parser context object that returns headers and extracted field indexes associated with a given processor in this switch.

Parameters
context:ParsingContext

the context to wrap

Returns:ParsingContext

a wrapped context that returns the headers and extracted field indexes from getHeaders() and getIndexes()

Annotations
@Override