RowWriterProcessor implementation that combines and allows switching among different
RowWriterProcessors. Concrete implementations of this class
are expected to implement the switchRowProcessor(T) method and analyze the input row
to determine whether or not the current RowWriterProcessor implementation must be changed to handle a special
circumstance (determined by the concrete implementation) such as a different row format.
When the row writer processor is switched, the rowProcessorSwitched(RowWriterProcessor, RowWriterProcessor)
will be called, and must be overridden, to notify the change to the user.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private NormalizedString[] | |
| private String[] | |
| private RowWriterProcessor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract String | |
| protected NormalizedString[] | Returns: the current sequence of headers to use.Returns the headers in use by the current row writer processor implementation, which can vary among row writer processors. |
| public abstract NormalizedString[] | Returns: the sequence of headers to use when processing the given input map.an optional map associating keys of the rowData map with expected header names headerMapping, Map<K, V> the record data mapInput)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. |
| public abstract NormalizedString[] | Returns: the sequence of headers to use when processing the given record.the record data input)Returns the sequence of headers to use for processing an input record. |
| protected int[] | Returns: the current sequence of indexes to use.Returns the indexes in use by the current row writer processor implementation, which can vary among row writer processors. |
| public final int | Returns: the minimum length a row must have in order to be sent to the outputReturns the minimum row length based on the number of headers and index sizes |
| public void | rowProcessorSwitched(RowWriterProcessor<?>
the row writer processor previously in use from, RowWriterProcessor<?> the new row writer processor to use to continue processing the output rows. to)Notifies a change of row writer processor implementation. |
| protected abstract RowWriterProcessor | Returns: the row writer processor implementation to use. If it is not the same as the one used by the previous row, the returned row writer processor will be used, and therowProcessorSwitched(RowWriterProcessor, RowWriterProcessor) method
will be called.a record with data to be written to the output row)Analyzes an output row to determine whether or not the row writer processor implementation must be changed |
| public Object[] | |
| public Object[] | write(Object
The original input record that must be converted into an Object array before writing to an output. input, NormalizedString[] All field names used to produce records in a given destination. May be null if no headers have been defined in headers, int[] CommonSettings#getHeaders()The indexes of the headers that are actually being written. May be null if no fields have been selected using indicesToWrite)CommonSettings#selectFields(String. or CommonSettings#selectIndexes(Integer.Implements com. |
| minimumRowLength | back to summary |
|---|---|
| private int minimumRowLength | |
| normalizedHeaders | back to summary |
|---|---|
| private NormalizedString[] normalizedHeaders | |
| previousHeaders | back to summary |
|---|---|
| private String[] previousHeaders | |
| selectedRowWriterProcessor | back to summary |
|---|---|
| private RowWriterProcessor<T> selectedRowWriterProcessor | |
| RowWriterProcessorSwitch | back to summary |
|---|---|
| public RowWriterProcessorSwitch() | |
| describeSwitch | back to summary |
|---|---|
| protected abstract String describeSwitch() | |
| getHeaders | back to summary |
|---|---|
| protected NormalizedString[] getHeaders() 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 abstract NormalizedString[] getHeaders(Map<K, V> headerMapping, Map<K, V> mapInput) 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.
| |
| getHeaders | back to summary |
|---|---|
| public abstract NormalizedString[] getHeaders(Object input) Returns the sequence of headers to use for processing an input record.
| |
| getIndexes | back to summary |
|---|---|
| protected int[] getIndexes() Returns the indexes in use by the current row writer processor implementation, which can vary among row writer processors.
If
| |
| getMinimumRowLength | back to summary |
|---|---|
| public final int getMinimumRowLength() Returns the minimum row length based on the number of headers and index sizes
| |
| rowProcessorSwitched | back to summary |
|---|---|
| public void rowProcessorSwitched(RowWriterProcessor<?> from, RowWriterProcessor<?> to) Notifies a change of row writer processor implementation. Users are expected to override this method to receive the notification.
| |
| switchRowProcessor | back to summary |
|---|---|
| protected abstract RowWriterProcessor Analyzes an output row to determine whether or not the row writer processor implementation must be changed
| |
| write | back to summary |
|---|---|
| public Object[] write(Object input, String[] headers, int[] indicesToWrite) | |
| write | back to summary |
|---|---|
| public Object[] write(Object input, NormalizedString[] headers, int[] indicesToWrite) Implements com. Doc from com. Converts the given input into an Object array that is suitable for writing. Used by format-specific writers that extend
| |