Top Description Methods
com.univocity.parsers.conversions

public Interface Conversion<I, O>

Known Direct Implementers
com.univocity.parsers.conversions.FormattedDateConversion, com.univocity.parsers.conversions.LowerCaseConversion, com.univocity.parsers.conversions.NullConversion, com.univocity.parsers.conversions.NullStringConversion, com.univocity.parsers.conversions.RegexConversion, com.univocity.parsers.conversions.TrimConversion, com.univocity.parsers.conversions.UpperCaseConversion, com.univocity.parsers.conversions.ValidatedConversion
Type Parameters
<I>
The input type to be converted to the output type O
<O>
The type of outputs produced by a conversion applied to the an input I. When used in conjunction with the com.univocity.parsers.annotations.Convert annotation, O should be compatible with the type of the annotated field.
Imports
com.univocity.parsers.common.processor.*

The interface that defines the conversion from one type of value to another, and vice versa. univocity-parsers provides a set of default conversions for usage with ObjectRowProcessor and ObjectRowWriterProcessor. Annotations in package com.univocity.parsers.annotations are associated with different Conversion implementations in com.univocity.parsers.conversions.
Author
Univocity Software Pty Ltd - [email protected]
See Also
com.univocity.parsers.common.processor.ObjectRowProcessor, com.univocity.parsers.common.processor.ObjectRowWriterProcessor

Method Summary

Modifier and TypeMethod and Description
public O

Returns:

the conversion result.
execute
(I
the input of type I to be converted to an object of type O
input
)

Converts a value of type I to a value of type O.

public I

Returns:

the conversion result.
revert
(O
the input of type O to be converted to an object of type I
input
)

Converts a value of type O to a value of type I.

Method Detail

executeback to summary
public O execute(I input)

Converts a value of type I to a value of type O. When used in conjunction with the com.univocity.parsers.annotations.Convert annotation, this method will perform the conversion from a parsed input String (if no other conversion has been applied before) to a value of the desired type, and the result will be assigned to the annotated field. Note that conversions can be chained so you need to make sure the input type of any previous conversion is compatible with I

Parameters
input:I

the input of type I to be converted to an object of type O

Returns:O

the conversion result.

revertback to summary
public I revert(O input)

Converts a value of type O to a value of type I. When used in conjunction with the com.univocity.parsers.annotations.Convert annotation, this method will convert the value of the annotated field so it can be written to the output (usually a String). Note that conversions can be chained so you need to make sure the type of any previous conversion is compatible with O

Parameters
input:O

the input of type O to be converted to an object of type I

Returns:I

the conversion result.