public class InputValueSwitch extends AbstractInputValueSwitch<ParsingContext> implements RowProcessor
RowProcessorSwitch
that allows switching among different implementations of
RowProcessor
based on values found on the rows parsed from the input.Constructor and Description |
---|
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 |
InputValueSwitch(int columnIndex)
Creates a switch that will analyze a column of rows parsed from the input to determine which
RowProcessor to use. |
InputValueSwitch(String columnName)
Creates a switch that will analyze a column in rows parsed from the input to determine which
RowProcessor to use. |
Modifier and Type | Method and Description |
---|---|
protected ParsingContext |
wrapContext(ParsingContext context)
Wraps a given parser context object that returns headers and extracted field indexes
associated with a given processor in this switch.
|
addSwitchForValue, addSwitchForValue, addSwitchForValue, addSwitchForValue, addSwitchForValue, addSwitchForValue, getHeaders, getIndexes, hasDefaultSwitch, setCaseSensitive, setComparator, setDefaultSwitch, setDefaultSwitch, setDefaultSwitch, switchRowProcessor
preventColumnReordering, processEnded, processorSwitched, processStarted, rowProcessed, rowProcessorSwitched
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processEnded, processStarted, rowProcessed
public InputValueSwitch()
RowProcessor
to use for each parsed rowpublic InputValueSwitch(int columnIndex)
RowProcessor
to use.columnIndex
- the column index whose value will be used to determine which RowProcessor
to use for each parsed row.public InputValueSwitch(String columnName)
RowProcessor
to use.columnName
- name of the column whose values will be used to determine which RowProcessor
to use for each parsed row.protected final ParsingContext wrapContext(ParsingContext context)
AbstractProcessorSwitch
wrapContext
in class AbstractProcessorSwitch<ParsingContext>
context
- the context to wrapAbstractProcessorSwitch.getHeaders()
and AbstractProcessorSwitch.getIndexes()
Copyright © 2019 Univocity Software Pty Ltd. All rights reserved.