Interface IDisplayConverter

All Known Implementing Classes:
ContextualDisplayConverter, DecimalNumericDisplayConverter, DefaultBigDecimalDisplayConverter, DefaultBigIntegerDisplayConverter, DefaultBooleanDisplayConverter, DefaultByteDisplayConverter, DefaultCharacterDisplayConverter, DefaultDateDisplayConverter, DefaultDisplayConverter, DefaultDoubleDisplayConverter, DefaultFloatDisplayConverter, DefaultIntegerDisplayConverter, DefaultLongDisplayConverter, DefaultShortDisplayConverter, DisplayConverter, FilterRowRegularExpressionConverter, FormulaEditDisplayConverter, FormulaResultDisplayConverter, GroupByDisplayConverter, MarkupDisplayConverter, NumericDisplayConverter, PercentageDisplayConverter, PricingTypeBeanDisplayConverter, SummaryDisplayConverter

public interface IDisplayConverter
Converts between two different data representations. The normal data representation is known as the canonical representation The representation displayed on the UI is called the display representation. For example, the canonical representation might be a Date object, whereas the target representation could be a formatted String.
  • Method Details

    • canonicalToDisplayValue

      Object canonicalToDisplayValue(Object canonicalValue)
      Convert backing data value to value to be displayed. Typically converts to a String for display.
      Parameters:
      canonicalValue - The data value from the backing data.
      Returns:
      The converted value to display.
    • displayToCanonicalValue

      Object displayToCanonicalValue(Object displayValue)
      Convert from display value to value in the backing data structure.

      NOTE:
      The type the display value is converted to must match the type in the setter of the backing bean/row object

      Parameters:
      displayValue - The display value that should be converted to the data value that matches the backing data.
      Returns:
      The converted value to put to the backing data.
    • canonicalToDisplayValue

      Object canonicalToDisplayValue(ILayerCell cell, IConfigRegistry configRegistry, Object canonicalValue)
      Convert backing data value to value to be displayed. Typically converts to a String for display. Use this method for contextual conversion.

      Note that on returning a different type than String, toString() will be called on the returned object to render the value for displaying.

      Parameters:
      cell - The ILayerCell whose canonical value should be converted.
      configRegistry - The IConfigRegistry of the NatTable to which the ILayerCell belongs.
      canonicalValue - The data value from the backing data.
      Returns:
      The converted value to display.
    • displayToCanonicalValue

      Object displayToCanonicalValue(ILayerCell cell, IConfigRegistry configRegistry, Object displayValue)
      Convert from display value to value in the backing data structure.

      NOTE:
      The type the display value is converted to must match the type in the setter of the backing bean/row object Use this method for contextual conversion.

      Parameters:
      cell - The ILayerCell whose canonical value should be converted.
      configRegistry - The IConfigRegistry of the NatTable to which the ILayerCell belongs.
      displayValue - The display value that should be converted to the data value that matches the backing data.
      Returns:
      The converted value to put to the backing data.