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 ImportColumnDataTransformer
A 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 boolean
Returns true if the ImporterColumnDefinition defines the column as a Constant Column.default boolean
Returns true if the ImporterColumnDefinition for the column has a formula attribute.default boolean
Returns true if the ImporterColumnDefinition for the column has a transform attribute.default void
The method supports transform, formula and constant attributes defined for boolean columns.default void
The method supports transform, formula and constant attributes defined for double columns.default void
The method supports transform, formula and constant attributes defined for float columns.default void
The method supports transform, formula and constant attributes defined for char columns.default void
The method supports transform, formula and constant attributes defined for number columns (byte, short, int and long).default void
The 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. TheMutableBoolean
parameter 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 currentMutableBoolean
object 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. TheMutableInt
parameter 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 currentMutableInt
object 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). TheMutableLong
parameter 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 currentMutableInt
object 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. TheMutableFloat
parameter 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 currentMutableFloat
object 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. TheMutableDouble
parameter 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 currentMutableDouble
object 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. TheMutableObject
parameter 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 currentMutableObject
object in string and other object parserssourceValue
- The cell value as a String, this is to support formulas that currently expect a String input
-