Top Description Methods
com.univocity.parsers.common

public Interface ConversionProcessor

Known Direct Implementers
com.univocity.parsers.common.DefaultConversionProcessor, com.univocity.parsers.common.processor.core.AbstractMultiBeanProcessor
Imports
com.univocity.parsers.common.fields.*, com.univocity.parsers.conversions.*

A basic interface for classes that associate Conversion implementations with fields of a given input/output.

Method Summary

Modifier and TypeMethod and Description
public void
convertAll(Conversion<I, O>...
The sequence of conversions to be executed in all elements of a record
conversions
)

Applies a set of Conversion objects over all elements of a record

public FieldSet<String>

Returns:

A FieldSet for field names.
convertFields
(Conversion<I, O>...
The sequence of conversions to be executed in a set of field indexes.
conversions
)

Applies a set of Conversion objects over fields of a record by name.

public FieldSet<Integer>

Returns:

A FieldSet for indexes.
convertIndexes
(Conversion<I, O>...
The sequence of conversions to be executed in a set of field indexes.
conversions
)

Applies a set of Conversion objects over indexes of a record.

public 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
)

Applies a sequence of conversions over values of a given type.

Method Detail

convertAllback to summary
public void convertAll(Conversion<I, O>... conversions)

Applies a set of Conversion objects over all elements of a record

Parameters
conversions:Conversion<I, O>[]

The sequence of conversions to be executed in all elements of a record

Annotations
@SuppressWarnings:rawtypes, unchecked
convertFieldsback to summary
public FieldSet<String> convertFields(Conversion<I, O>... conversions)

Applies a set of Conversion objects 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:Conversion<I, O>[]

The sequence of conversions to be executed in a set of field indexes.

Returns:FieldSet<String>

A FieldSet for field names.

Annotations
@SuppressWarnings:unchecked, rawtypes
convertIndexesback to summary
public FieldSet<Integer> convertIndexes(Conversion<I, O>... conversions)

Applies a set of Conversion objects 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:Conversion<I, O>[]

The sequence of conversions to be executed in a set of field indexes.

Returns:FieldSet<Integer>

A FieldSet for indexes.

Annotations
@SuppressWarnings:unchecked, rawtypes
convertTypeback to summary
public void convertType(Class<?> type, Conversion<I, O>... conversions)

Applies a sequence of conversions over values of a given type. Used for writing.

Parameters
type:Class<?>

the type over which a sequence of conversions should be applied

conversions:Conversion<I, O>[]

the sequence of conversions to apply over values of the given type.