RowProcessor and RowWriterProcessor implementations that support value conversions provided by Conversion instances.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Context | |
| protected FieldConversionMapping | |
| private Map | |
| private boolean | |
| pack-priv ProcessorErrorHandler | |
| private int[] | |
| private boolean | |
| private int[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final Object[] | Returns: an row of Object instances containing the values obtained after the execution of all conversions.Fields that do not have any conversion defined will just be copied to the object array into their original positions. the parsed record with its individual records as extracted from the original input. row, Context the current state of the parsing process. context)Executes the sequences of conversions defined using |
| private boolean | |
| private Object | |
| public final void | convertAll(Conversion<I, O>...
The sequence of conversions to be executed in all elements of a record conversions)Implements com. Conversion objects over all elements of a record
|
| public final FieldSet | convertFields(Conversion<I, O>...
The sequence of conversions to be executed in a set of field indexes. conversions)Implements com. Conversion objects over fields of a record by name.
|
| public final FieldSet | convertIndexes(Conversion<I, O>...
The sequence of conversions to be executed in a set of field indexes. conversions)Implements com. Conversion objects over indexes of a record.
|
| public final void | convertType(Class<?>
the type over which a sequence of conversions should be applied type, Conversion<I, O>... the sequence of conversions to apply over values of the given type. conversions)Implements com. |
| private FieldConversionMapping | |
| protected final boolean | Returns: true if the error has been handled by the user and the record can still be processed, otherwise
false if the record should be discarded.the exception that occurred when applying a conversion ex, Object[] the record being processed at the time the exception happened. row, int the column if the given row, whose value could not be converted. If negative, it's not possible to
keep the record. column)Handles an error that occurred when applying conversions over a value. |
| protected void | |
| private void | |
| public final boolean | Returns: true if the the row should be discardedflag to indicate whether the conversion sequence should be executed in the reverse order of its declaration. executeInReverseOrder, Object[] the row of objects that will be converted row, 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 indexesToWrite)CommonSettings#selectFields(String. or CommonSettings#selectIndexes(Integer.Executes the sequences of reverse conversions defined using |
| protected DataProcessingException | |
| private boolean |
| context | back to summary |
|---|---|
| pack-priv Context context | |
| conversions | back to summary |
|---|---|
| protected FieldConversionMapping conversions | |
| conversionsByType | back to summary |
|---|---|
| private Map<Class<?>, Conversion<I, O>[]> conversionsByType | |
| conversionsInitialized | back to summary |
|---|---|
| private boolean conversionsInitialized | |
| errorHandler | back to summary |
|---|---|
| pack-priv ProcessorErrorHandler<T extends Context> errorHandler | |
| fieldIndexes | back to summary |
|---|---|
| private int[] fieldIndexes | |
| fieldsReordered | back to summary |
|---|---|
| private boolean fieldsReordered | |
| reverseFieldIndexes | back to summary |
|---|---|
| private int[] reverseFieldIndexes | |
| DefaultConversionProcessor | back to summary |
|---|---|
| public DefaultConversionProcessor() | |
| applyConversions | back to summary |
|---|---|
| public final Object[] applyConversions(String[] row, Context context) Executes the sequences of conversions defined using Each field will be transformed using the In general the conversions will process a String and convert it to some object value (such as booleans, dates, etc).
| |
| applyConversionsByType | back to summary |
|---|---|
| private boolean applyConversionsByType(boolean reverse, Object[] row, boolean[] convertedFlags) | |
| applyTypeConversion | back to summary |
|---|---|
| private Object applyTypeConversion(boolean revert, Object input) | |
| convertAll | back to summary |
|---|---|
| public final void convertAll(Conversion<I, O>... conversions) Implements com. Doc from com. Applies a set of
| |
| convertFields | back to summary |
|---|---|
| public final FieldSet Implements com. Doc from com. Applies a set of The idiom to define which fields should have these conversions applied is as follows:
| |
| convertIndexes | back to summary |
|---|---|
| public final FieldSet Implements com. Doc from com. Applies a set of The idiom to define which indexes should have these conversions applies is as follows: processor.convertIndexes(Conversions.trim(), Conversions.toUpperCase()).add(2, 5); // applies trim and uppercase conversions to fields in indexes 2 and 5
| |
| convertType | back to summary |
|---|---|
| public final void convertType(Class<?> type, Conversion<I, O>... conversions) Implements com. Doc from com. Applies a sequence of conversions over values of a given type. Used for writing.
| |
| getConversions | back to summary |
|---|---|
| private FieldConversionMapping getConversions() | |
| handleConversionError | back to summary |
|---|---|
| protected final boolean handleConversionError(Throwable ex, Object[] row, int column) Handles an error that occurred when applying conversions over a value. If the user defined a
| |
| initializeConversions | back to summary |
|---|---|
| protected void initializeConversions(String[] row, Context context) | |
| populateReverseFieldIndexes | back to summary |
|---|---|
| private void populateReverseFieldIndexes() | |
| reverseConversions | back to summary |
|---|---|
| public final boolean reverseConversions(boolean executeInReverseOrder, Object[] row, NormalizedString[] headers, int[] indexesToWrite) Executes the sequences of reverse conversions defined using Each field will be transformed using the In general the conversions will process an Object (such as a Boolean, Date, etc), and convert it to a String representation.
| |
| toDataProcessingException | back to summary |
|---|---|
| protected DataProcessingException toDataProcessingException(Throwable ex, Object[] row, int column) | |
| validateAllValues | back to summary |
|---|---|
| private boolean validateAllValues(Object[] objectRow) | |