RowWriterProcessorSwitch that allows switching among different implementations of
RowWriterProcessor based on values found on rows to be written to an output
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private Comparator | |
| private OutputValueSwitch. | |
| private final String | |
| private OutputValueSwitch. | |
| private OutputValueSwitch. | |
| private Class |
| Access | Constructor and Description |
|---|---|
| public | OutputValueSwitch()
Creates a switch that will analyze the first column of output rows to determine which
|
| public | OutputValueSwitch(int
the column index whose value will be used to determine which columnIndex)RowWriterProcessor to use for each output row.Creates a switch that will analyze a column of output rows to determine which
|
| public | OutputValueSwitch(String
the column name whose value will be used to determine which headerName)RowWriterProcessor to use for each output row.Creates a switch that will analyze a column of output rows to determine which |
| public | OutputValueSwitch(String
the column name whose value will be used to determine which headerName, int RowWriterProcessor to use for each output row.the position of an input column to use to perform the switch when no headers are available. columnIndex)Creates a switch that will analyze a column of output rows to determine which
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public < the type of annotated java beans whose instances will be used to trigger the usage of a different format. T> void | addSwitchForType(Class<T>
the type of annotated java beans whose instances will be used to trigger the usage of a different format. beanType, String... the (optional) sequence of headers to assign to the given row writer processor headersToUse)Associates a |
| public < the type of annotated java beans whose instances will be used to trigger the usage of a different format. T> void | addSwitchForType(Class<T>
the type of annotated java beans whose instances will be used to trigger the usage of a different format. beanType, int... the (optional) sequence of column indexes to assign to the given row writer processor indexesToUse)Associates a |
| public < the type of annotated java beans whose instances will be used to trigger the usage of a different format. T> void | addSwitchForType(Class<T>
the type of annotated java beans whose instances will be used to trigger the usage of a different format. beanType)Associates a |
| public void | addSwitchForValue(Object
the value to match against the column of incoming output rows and trigger the usage of the given row writer processor implementation. value, RowWriterProcessor<Object[]> the row writer processor implementation to use when the given value matches with the contents of the column provided in the constructor of this class. rowProcessor, String... the (optional) sequence of headers to assign to the given row writer processor headersToUse)Associates a |
| public void | addSwitchForValue(Object
the value to match against the column of incoming output rows and trigger the usage of the given row writer processor implementation. value, RowWriterProcessor<Object[]> the row writer processor implementation to use when the given value matches with the contents of the column provided in the constructor of this class. rowProcessor)Associates a |
| public void | addSwitchForValue(Object
the value to match against the column of incoming output rows and trigger the usage of the given row writer processor implementation. value, RowWriterProcessor<Object[]> the row writer processor implementation to use when the given value matches with the contents of the column provided in the constructor of this class. rowProcessor, int... the (optional) sequence of column indexes to assign to the given row writer processor indexesToUse)Associates a |
| protected String | describeSwitch()
Implements abstract com. |
| public int | Returns: the column index targeted by this switch.Returns the column index whose values will be used to switching from a row processor to another. |
| protected NormalizedString[] | getHeaders()
Overrides com. |
| public NormalizedString[] | getHeaders(Object
the record data input)Implements abstract com. |
| public NormalizedString[] | getHeaders(Map<K, V>
an optional map associating keys of the rowData map with expected header names headerMapping, Map<K, V> the record data mapInput)Implements abstract com. |
| private NormalizedString[] | |
| protected int[] | getIndexes()
Overrides com. |
| private OutputValueSwitch. | |
| private List | |
| private String | |
| private int | |
| private <V> V | |
| public void | setComparator(Comparator<?>
the comparator to use for matching values in the output column with the values provided in comparator)addSwitchForValue(Object, RowWriterProcessor)Configures the switch to use a custom |
| public void | setDefaultSwitch(RowWriterProcessor<Object[]>
the default row writer processor implementation rowProcessor, String... the (optional) sequence of headers to assign to the given row writer processor headersToUse)Defines a default |
| public void | setDefaultSwitch(RowWriterProcessor<Object[]>
the default row writer processor implementation rowProcessor, int... the (optional) sequence of column indexes to assign to the given row writer processor indexesToUse)Defines a default |
| protected RowWriterProcessor | switchRowProcessor(Object
a record with data to be written to the output row)Implements abstract com. |
| columnIndex | back to summary |
|---|---|
| private final int columnIndex | |
| comparator | back to summary |
|---|---|
private Comparator<T> comparator
| |
| defaultSwitch | back to summary |
|---|---|
| private OutputValueSwitch. | |
| headerName | back to summary |
|---|---|
| private final String headerName | |
| selectedSwitch | back to summary |
|---|---|
| private OutputValueSwitch. | |
| switches | back to summary |
|---|---|
| private OutputValueSwitch. | |
| types | back to summary |
|---|---|
| private Class<T>[] types | |
| OutputValueSwitch | back to summary |
|---|---|
| public OutputValueSwitch() Creates a switch that will analyze the first column of output rows to determine which
| |
| OutputValueSwitch | back to summary |
|---|---|
| public OutputValueSwitch(int columnIndex) Creates a switch that will analyze a column of output rows to determine which
| |
| OutputValueSwitch | back to summary |
|---|---|
| public OutputValueSwitch(String headerName) Creates a switch that will analyze a column of output rows to determine which
| |
| OutputValueSwitch | back to summary |
|---|---|
| public OutputValueSwitch(String headerName, int columnIndex) Creates a switch that will analyze a column of output rows to determine which
| |
| addSwitch | back to summary |
|---|---|
| private void addSwitch(OutputValueSwitch. | |
| addSwitchForType | back to summary |
|---|---|
| public <T> void addSwitchForType(Class<T> beanType, String... headersToUse) Associates a
| |
| addSwitchForType | back to summary |
|---|---|
| public <T> void addSwitchForType(Class<T> beanType, int... indexesToUse) Associates a
| |
| addSwitchForType | back to summary |
|---|---|
| public <T> void addSwitchForType(Class<T> beanType) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(Object value, RowWriterProcessor<Object[]> rowProcessor, String... headersToUse) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(Object value, RowWriterProcessor<Object[]> rowProcessor) Associates a
| |
| addSwitchForValue | back to summary |
|---|---|
| public void addSwitchForValue(Object value, RowWriterProcessor<Object[]> rowProcessor, int... indexesToUse) Associates a
| |
| describeSwitch | back to summary |
|---|---|
| protected String describeSwitch() Implements abstract com.
| |
| getColumnIndex | back to summary |
|---|---|
| public int getColumnIndex() Returns the column index whose values will be used to switching from a row processor to another.
| |
| getHeaders | back to summary |
|---|---|
| protected NormalizedString[] getHeaders() Overrides com. Doc from com. Returns the headers in use by the current row writer processor implementation, which can vary among row writer processors.
If
| |
| getHeaders | back to summary |
|---|---|
| public NormalizedString[] getHeaders(Object input) Implements abstract com. Doc from com. Returns the sequence of headers to use for processing an input record.
| |
| getHeaders | back to summary |
|---|---|
| public NormalizedString[] getHeaders(Map<K, V> headerMapping, Map<K, V> mapInput) Implements abstract com. Doc from com. Returns the sequence of headers to use for processing an input record represented by a map A map of headers can be optionally provided to assign a name to the keys of the input map. This is useful when the input map has keys will generate unwanted header names.
| |
| getHeadersFromSwitch | back to summary |
|---|---|
| private NormalizedString[] getHeadersFromSwitch(Object value) | |
| getIndexes | back to summary |
|---|---|
| protected int[] getIndexes() Overrides com. Doc from com. Returns the indexes in use by the current row writer processor implementation, which can vary among row writer processors.
If
| |
| getSwitch | back to summary |
|---|---|
| private OutputValueSwitch. | |
| getSwitchValues | back to summary |
|---|---|
| private List | |
| getValidatedHeaderName | back to summary |
|---|---|
| private String getValidatedHeaderName(String headerName) | |
| getValidatedIndex | back to summary |
|---|---|
| private int getValidatedIndex(int columnIndex) | |
| getValue | back to summary |
|---|---|
| private <V> V getValue(Map<?, V> map, int index) | |
| setComparator | back to summary |
|---|---|
| public void setComparator(Comparator<?> comparator) Configures the switch to use a custom
| |
| setDefaultSwitch | back to summary |
|---|---|
| public void setDefaultSwitch(RowWriterProcessor<Object[]> rowProcessor, String... headersToUse) Defines a default
| |
| setDefaultSwitch | back to summary |
|---|---|
| public void setDefaultSwitch(RowWriterProcessor<Object[]> rowProcessor, int... indexesToUse) Defines a default
| |
| switchRowProcessor | back to summary |
|---|---|
| protected RowWriterProcessor Implements abstract com. Doc from com. Analyzes an output row to determine whether or not the row writer processor implementation must be changed
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final NormalizedString[] | |
| pack-priv final int[] | |
| pack-priv final RowWriterProcessor | |
| pack-priv final Object |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| private |
| headers | back to summary |
|---|---|
| pack-priv final NormalizedString[] headers | |
| indexes | back to summary |
|---|---|
| pack-priv final int[] indexes | |
| processor | back to summary |
|---|---|
| pack-priv final RowWriterProcessor<Object[]> processor | |
| value | back to summary |
|---|---|
| pack-priv final Object value | |
| Switch | back to summary |
|---|---|
| pack-priv Switch(RowWriterProcessor<Object[]> processor, String[] headers, int[] indexes, Object value) | |
| Switch | back to summary |
|---|---|
| pack-priv Switch(String[] headers, int[] indexes, Class<?> type) | |
| Switch | back to summary |
|---|---|
| private Switch(RowWriterProcessor<Object[]> processor, String[] headers, int[] indexes, Object value, Class<?> type) | |