Processor that allows switching among different implementations of
Processor based on values found on the rows parsed from the input.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final Comparator | |
| private static final Comparator | |
| private int | |
| private NormalizedString | |
| private Comparator | |
| private AbstractInputValueSwitch. | |
| private String[] | |
| private int[] | |
| private AbstractInputValueSwitch. |
| Access | Constructor and Description |
|---|---|
| public | AbstractInputValueSwitch()
Creates a switch that will analyze the first column of rows found in the input to determine which
|
| public | AbstractInputValueSwitch(int
the column index whose value will be used to determine which columnIndex)Processor to use for each parsed row.Creates a switch that will analyze a column of rows parsed from the input to determine which
|
| public | AbstractInputValueSwitch(String
name of the column whose values will be used to determine which columnName)Processor to use for each parsed row.Creates a switch that will analyze a column in rows parsed from the input to determine which
|
| Modifier and Type | Method and Description |
|---|---|
| public void | addSwitchForValue(String
the value to match against the column of the current input row and trigger the usage of the given processor implementation. value, Processor<T> the processor implementation when the given value matches with the contents in the column provided in the constructor of this class. processor)Associates a |
| public void | addSwitchForValue(String
the value to match against the column of the current input row and trigger the usage of the given processor implementation. value, Processor<T> the processor implementation when the given value matches with the contents in the column provided in the constructor of this class. processor, String... the (optional) sequence of headers to assign to the headersToUse)ParsingContext of the given processorAssociates a |
| public void | addSwitchForValue(CustomMatcher
a user defined matching implementation to execute against the values in the column of the current input row and trigger the usage of the given processor implementation. matcher, Processor<T> the processor implementation when the given value matches with the contents in the column provided in the constructor of this class. processor)Associates a |
| public void | addSwitchForValue(CustomMatcher
a user defined matching implementation to execute against the values in the column of the current input row and trigger the usage of the given processor implementation. matcher, Processor<T> the processor implementation when the given value matches with the contents in the column provided in the constructor of this class. processor, String... the (optional) sequence of headers to assign to the headersToUse)ParsingContext of the given processorAssociates a |
| public void | addSwitchForValue(String
the value to match against the column of the current input row and trigger the usage of the given processor implementation. value, Processor<T> the processor implementation when the given value matches with the contents in the column provided in the constructor of this class. processor, int... the (optional) sequence of column indexes to assign to the indexesToUse)ParsingContext of the given processorAssociates a |
| public void | addSwitchForValue(CustomMatcher
a user defined matching implementation to execute against the values in the column of the current input row and trigger the usage of the given processor implementation. matcher, Processor<T> the processor implementation when the given value matches with the contents in the column provided in the constructor of this class. processor, int... the (optional) sequence of column indexes to assign to the indexesToUse)ParsingContext of the given processorAssociates a |
| public String[] | getHeaders()
Overrides com. |
| public int[] | getIndexes()
Overrides com. |
| public boolean | Returns: true if a Processor implementation has been provided to process input rows that doesn't have any matching value.Returns a flag indicating whether this switch contains a default |
| public void | setCaseSensitive(boolean
a flag indicating whether the switch should compare values not considering the character case. caseSensitive)Configures the switch to be case sensitive when comparing values provided in |
| public void | setComparator(Comparator<String>
the comparator to use for matching values in the input column with the values provided in comparator)addSwitchForValue(String, Processor, String.Configures the switch to use a custom |
| public void | setDefaultSwitch(Processor<T>
the default processor implementation processor, String... the (optional) sequence of headers to assign to the headersToUse)ParsingContext of the given processorDefines a default |
| public void | setDefaultSwitch(Processor<T>
the default processor implementation processor)Defines a default |
| public void | setDefaultSwitch(Processor<T>
the default processor implementation processor, int... the (optional) sequence of column indexes to assign to the indexesToUse)ParsingContext of the given processorDefines a default |
| protected final Processor | switchRowProcessor(String[]
a row parsed from the input row, T the current parsing context (not associated with the current row processor used by this class) context)Implements abstract com. |
| caseInsensitiveComparator | back to summary |
|---|---|
| private static final Comparator<String> caseInsensitiveComparator | |
| caseSensitiveComparator | back to summary |
|---|---|
| private static final Comparator<String> caseSensitiveComparator | |
| columnIndex | back to summary |
|---|---|
| private int columnIndex | |
| columnName | back to summary |
|---|---|
| private NormalizedString columnName | |
| comparator | back to summary |
|---|---|
| private Comparator<String> comparator | |
| defaultSwitch | back to summary |
|---|---|
| private AbstractInputValueSwitch. | |
| headers | back to summary |
|---|---|
| private String[] headers | |
| indexes | back to summary |
|---|---|
| private int[] indexes | |
| switches | back to summary |
|---|---|
| private AbstractInputValueSwitch. | |
| AbstractInputValueSwitch | back to summary |
|---|---|
| public AbstractInputValueSwitch() Creates a switch that will analyze the first column of rows found in the input to determine which
| |
| AbstractInputValueSwitch | back to summary |
|---|---|
| public AbstractInputValueSwitch(int columnIndex) Creates a switch that will analyze a column of rows parsed from the input to determine which
| |
| AbstractInputValueSwitch | back to summary |
|---|---|
| public AbstractInputValueSwitch(String columnName) Creates a switch that will analyze a column in rows parsed from the input to determine which
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(String value, Processor<T> processor) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(String value, Processor<T> processor, String... headersToUse) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(CustomMatcher matcher, Processor<T> processor) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(CustomMatcher matcher, Processor<T> processor, String... headersToUse) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(String value, Processor<T> processor, int... indexesToUse) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(CustomMatcher matcher, Processor<T> processor, int... indexesToUse) Associates a
| |
| getHeaders | back to summary |
|---|---|
| public String[] getHeaders() Overrides com. Doc from com. Returns the headers in use by the current row processor implementation, which can vary among row processors.
If | |
| getIndexes | back to summary |
|---|---|
| public int[] getIndexes() Overrides com. Doc from com. Returns the indexes in use by the current row processor implementation, which can vary among row processors.
If
| |
| hasDefaultSwitch | back to summary |
|---|---|
| public boolean hasDefaultSwitch() Returns a flag indicating whether this switch contains a default
| |
| setCaseSensitive | back to summary |
|---|---|
| public void setCaseSensitive(boolean caseSensitive) Configures the switch to be case sensitive when comparing values provided in
| |
| setComparator | back to summary |
|---|---|
| public void setComparator(Comparator<String> comparator) Configures the switch to use a custom
| |
| setDefaultSwitch | back to summary |
|---|---|
| public void setDefaultSwitch(Processor<T> processor, String... headersToUse) Defines a default
| |
| setDefaultSwitch | back to summary |
|---|---|
| public void setDefaultSwitch(Processor<T> processor) Defines a default
| |
| setDefaultSwitch | back to summary |
|---|---|
| public void setDefaultSwitch(Processor<T> processor, int... indexesToUse) Defines a default
| |
| switchRowProcessor | back to summary |
|---|---|
| protected final Processor Implements abstract com. Doc from com. Analyzes the input to determine whether or not the row processor implementation must be changed
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final String[] | |
| pack-priv final int[] | |
| pack-priv final CustomMatcher | |
| pack-priv final Processor | |
| pack-priv final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | Switch(Processor<T> processor, String[] headers, int[] indexes, String value, CustomMatcher matcher)
|
| Modifier and Type | Method and Description |
|---|---|
| public String |
| headers | back to summary |
|---|---|
| pack-priv final String[] headers | |
| indexes | back to summary |
|---|---|
| pack-priv final int[] indexes | |
| matcher | back to summary |
|---|---|
| pack-priv final CustomMatcher matcher | |
| processor | back to summary |
|---|---|
| pack-priv final Processor<T> processor | |
| value | back to summary |
|---|---|
| pack-priv final String value | |
| Switch | back to summary |
|---|---|
| pack-priv Switch(Processor<T> processor, String[] headers, int[] indexes, String value, CustomMatcher matcher) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |