Package com.illumon.iris.importers
Interface ImportColumnDataTransformer
- All Known Implementing Classes:
CsvColumnDataTransformer
public interface ImportColumnDataTransformer
Interface for handling transformations from custom implementations of
Parser.
Custom transformations in import columns can include transform, formula and constant attributes provided in schema definition.
The Interface provides default implementations. Implementing classes should override applicable methods.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImportColumnDataTransformerA default implementation that doesn't support any of transform, formulas or constants and will throw UnsupportedOperationException if used for transforms. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturns true if the ImporterColumnDefinition defines the column as a Constant Column.default booleanReturns true if the ImporterColumnDefinition for the column has a formula attribute.default booleanReturns true if the ImporterColumnDefinition for the column has a transform attribute.default voidThe method supports transform, formula and constant attributes defined for boolean columns.default voidThe method supports transform, formula and constant attributes defined for double columns.default voidThe method supports transform, formula and constant attributes defined for float columns.default voidThe method supports transform, formula and constant attributes defined for char columns.default voidThe method supports transform, formula and constant attributes defined for number columns (byte, short, int and long).default voidThe method supports transform, formula and constant attributes defined for non-primitive columns.
-
Field Details
-
DEFAULT_DATA_TRANSFORMER
A default implementation that doesn't support any of transform, formulas or constants and will throw UnsupportedOperationException if used for transforms.
-
-
Method Details
-
hasTransform
default boolean hasTransform()Returns true if the ImporterColumnDefinition for the column has a transform attribute. -
hasFormula
default boolean hasFormula()Returns true if the ImporterColumnDefinition for the column has a formula attribute. -
hasConstant
default boolean hasConstant()Returns true if the ImporterColumnDefinition defines the column as a Constant Column. -
transform
default void transform(@NotNull io.deephaven.csv.util.MutableBoolean holder, @Nullable String sourceValue) The method supports transform, formula and constant attributes defined for boolean columns. TheMutableBooleanparameter should hold the current raw value in parser. The method will then update this value by applying defined transformations. In case of formulas the sourceValue parameter will be used as the raw value. The Factory that generates the dynamic transformers for a boolean column source should override this method.- Parameters:
holder- The currentMutableBooleanobject in parser to apply and update with transformed valuesourceValue- The cell value as a String, this is to support formulas that currently expect a String input
-
transform
default void transform(@NotNull io.deephaven.csv.util.MutableInt holder, @Nullable String sourceValue) The method supports transform, formula and constant attributes defined for char columns. TheMutableIntparameter should hold the current raw value in parser. The method will then update this value by applying defined transformations. In case of formulas the sourceValue parameter will be used as the raw value. The Factory that generates the dynamic transformers for a char column source should override this method.- Parameters:
holder- The currentMutableIntobject in parser to apply and update with transformed valuesourceValue- The cell value as a String, this is to support formulas that currently expect a String input
-
transform
default void transform(@NotNull io.deephaven.csv.util.MutableLong holder, @Nullable String sourceValue) The method supports transform, formula and constant attributes defined for number columns (byte, short, int and long). TheMutableLongparameter should hold the current raw value in parser. The method will then update this value by applying defined transformations. In case of formulas the sourceValue parameter will be used as the raw value. The Factory that generates the dynamic transformers for Byte, Short, Int and Long column sources should override this method.- Parameters:
holder- The currentMutableIntobject in parser((ByteParser, ShortParser, IntParser, LongParser)) to apply and update with transformed valuesourceValue- The cell value as a String, this is to support formulas that currently expect a String input
-
transform
default void transform(@NotNull io.deephaven.csv.util.MutableFloat holder, @Nullable String sourceValue) The method supports transform, formula and constant attributes defined for float columns. TheMutableFloatparameter should hold the current raw value in parser. The method will then update this value by applying defined transformations. In case of formulas the sourceValue parameter will be used as the raw value. The Factory that generates the dynamic transformers for float column sources should override this method.- Parameters:
holder- The currentMutableFloatobject in FloatStrictParser to apply and update with transformed valuesourceValue- The cell value as a String, this is to support formulas that currently expect a String input
-
transform
default void transform(@NotNull io.deephaven.csv.util.MutableDouble holder, @Nullable String sourceValue) The method supports transform, formula and constant attributes defined for double columns. TheMutableDoubleparameter should hold the current raw value in parser. The method will then update this value by applying defined transformations. In case of formulas the sourceValue parameter will be used as the raw value. The Factory that generates the dynamic transformers for double column sources should override this method.- Parameters:
holder- The currentMutableDoubleobject in Double Parser to apply and update with transformed valuesourceValue- The cell value as a String, this is to support formulas that currently expect a String input
-
transform
default void transform(@NotNull io.deephaven.csv.util.MutableObject holder, @Nullable String sourceValue) The method supports transform, formula and constant attributes defined for non-primitive columns. TheMutableObjectparameter should hold the current raw value in parser. The method will then update this value by applying defined transformations. In case of formulas the sourceValue parameter will be used as the raw value. The Factory that generates the dynamic transformers for non-primitive object sources including array column sources should override this method.- Parameters:
holder- The currentMutableObjectobject in string and other object parserssourceValue- The cell value as a String, this is to support formulas that currently expect a String input
-