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

    Fields
    Modifier and Type
    Field
    Description
    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 Type
    Method
    Description
    default 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
    transform(io.deephaven.csv.util.MutableBoolean holder, String sourceValue)
    The method supports transform, formula and constant attributes defined for boolean columns.
    default void
    transform(io.deephaven.csv.util.MutableDouble holder, String sourceValue)
    The method supports transform, formula and constant attributes defined for double columns.
    default void
    transform(io.deephaven.csv.util.MutableFloat holder, String sourceValue)
    The method supports transform, formula and constant attributes defined for float columns.
    default void
    transform(io.deephaven.csv.util.MutableInt holder, String sourceValue)
    The method supports transform, formula and constant attributes defined for char columns.
    default void
    transform(io.deephaven.csv.util.MutableLong holder, String sourceValue)
    The method supports transform, formula and constant attributes defined for number columns (byte, short, int and long).
    default void
    transform(io.deephaven.csv.util.MutableObject holder, String sourceValue)
    The method supports transform, formula and constant attributes defined for non-primitive columns.
  • Field Details

    • DEFAULT_DATA_TRANSFORMER

      static final ImportColumnDataTransformer 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. The MutableBoolean 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 current MutableBoolean object in parser to apply and update with transformed value
      sourceValue - 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. The MutableInt 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 current MutableInt object in parser to apply and update with transformed value
      sourceValue - 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). The MutableLong 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 current MutableInt object in parser((ByteParser, ShortParser, IntParser, LongParser)) to apply and update with transformed value
      sourceValue - 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. The MutableFloat 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 current MutableFloat object in FloatStrictParser to apply and update with transformed value
      sourceValue - 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. The MutableDouble 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 current MutableDouble object in Double Parser to apply and update with transformed value
      sourceValue - 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. The MutableObject 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 current MutableObject object in string and other object parsers
      sourceValue - The cell value as a String, this is to support formulas that currently expect a String input