Package com.univocity.parsers.common
Interface ConversionProcessor
-
- All Known Implementing Classes:
AbstractBatchedObjectColumnProcessor,AbstractBeanListProcessor,AbstractBeanProcessor,AbstractMasterDetailListProcessor,AbstractMasterDetailProcessor,AbstractMultiBeanListProcessor,AbstractMultiBeanProcessor,AbstractMultiBeanRowProcessor,AbstractObjectColumnProcessor,AbstractObjectListProcessor,AbstractObjectProcessor,BatchedObjectColumnProcessor,BeanConversionProcessor,BeanListProcessor,BeanProcessor,BeanWriterProcessor,DefaultConversionProcessor,MasterDetailListProcessor,MasterDetailProcessor,MultiBeanListProcessor,MultiBeanProcessor,MultiBeanRowProcessor,ObjectColumnProcessor,ObjectRowListProcessor,ObjectRowProcessor,ObjectRowWriterProcessor
public interface ConversionProcessorA basic interface for classes that associateConversionimplementations with fields of a given input/output.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconvertAll(Conversion... conversions)Applies a set ofConversionobjects over all elements of a recordFieldSet<java.lang.String>convertFields(Conversion... conversions)Applies a set ofConversionobjects over fields of a record by name.FieldSet<java.lang.Integer>convertIndexes(Conversion... conversions)Applies a set ofConversionobjects over indexes of a record.voidconvertType(java.lang.Class<?> type, Conversion... conversions)Applies a sequence of conversions over values of a given type.
-
-
-
Method Detail
-
convertIndexes
FieldSet<java.lang.Integer> convertIndexes(Conversion... conversions)
Applies a set ofConversionobjects over indexes of a record.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
- Parameters:
conversions- The sequence of conversions to be executed in a set of field indexes.- Returns:
- A
FieldSetfor indexes.
-
convertAll
void convertAll(Conversion... conversions)
Applies a set ofConversionobjects over all elements of a record- Parameters:
conversions- The sequence of conversions to be executed in all elements of a record
-
convertFields
FieldSet<java.lang.String> convertFields(Conversion... conversions)
Applies a set ofConversionobjects over fields of a record by name.The idiom to define which fields should have these conversions applied is as follows:
processor.convertFields(Conversions.trim(), Conversions.toUpperCase()).add("name", "position"); // applies trim and uppercase conversions to fields with headers "name" and "position"- Parameters:
conversions- The sequence of conversions to be executed in a set of field indexes.- Returns:
- A
FieldSetfor field names.
-
convertType
void convertType(java.lang.Class<?> type, Conversion... conversions)Applies a sequence of conversions over values of a given type. Used for writing.- Parameters:
type- the type over which a sequence of conversions should be appliedconversions- the sequence of conversions to apply over values of the given type.
-
-