Package com.activeviam.source.common.api
Interface ITranslator<I,O,CalcT>
- Type Parameters:
I- The type of the input to translate.O- The type to translate to.CalcT- the input type of the column calculators
- All Known Subinterfaces:
IColumnarTranslator<O>,IHeaderTranslator<T>,IMapTranslator,ITupleTranslator
- All Known Implementing Classes:
AColumnarTranslator,AHeaderTranslator,ATranslator,ATranslatorWithColumnCalculators,HeaderColumnarTranslator,IdentityTranslator,JdbcTuplizer,KeyValueTuplizer,MapTranslator,MapTuplizer,PojoTuplizer,TupleTranslator
public interface ITranslator<I,O,CalcT>
Translates an input object into an output object. Often used in messaging implementations that
convert input data into a proper record. The ITranslator interface defines a translator whose
purpose is to transform data from a data source (CSV / JDBC / POJO...) into an output format. An
ITranslator will very likely make use of
IColumnCalculator to parse the input data into
the output format.- Author:
- ActiveViam
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves mapping name to column index in the output.voidsetColumnCalculators(List<IColumnCalculator<CalcT>> columnCalculators) Deprecated, for removal: This API element is subject to removal in a future version.Use instead the constructors of the implementation classes to set this parameter.Translate the input into an output format.
-
Method Details
-
translate
Translate the input into an output format.- Parameters:
input- The input to translate into an output.- Returns:
- output object
-
setColumnCalculators
@Deprecated(since="6.1.1", forRemoval=true) @DeprecatedApi(forRemoval="6.2", rationale="Only available on concrete implementations based on column calculators.") void setColumnCalculators(List<IColumnCalculator<CalcT>> columnCalculators) Deprecated, for removal: This API element is subject to removal in a future version.Use instead the constructors of the implementation classes to set this parameter.Configure the translator with its ordered list of column calculators. The order of the calculators in the list do matter: a given calculator should not be using values of columns that are set from calculators later in the list.- Parameters:
columnCalculators- The column calculators.
-
getColumnIndexes
Retrieves mapping name to column index in the output.- Returns:
- The column indexes of the output.
-