Class DateLocalDateTranslator

java.lang.Object
org.tentackle.fx.translate.AbstractValueTranslator<Date, LocalDate>
org.tentackle.fx.atlanta.translate.DateLocalDateTranslator
All Implemented Interfaces:
ValueTranslator<Date, LocalDate>

@ValueTranslatorService(modelClass=Date.class, viewClass=LocalDate.class) public class DateLocalDateTranslator extends AbstractValueTranslator<Date, LocalDate>
Date to LocalDate translator.
Provided for the Calendar control.

Applies to Date and all its subclasses. When translating back to the model, the returned object is of the same class as the component's model type: Date, Date, Timestamp, Timestamp or, for all other types, Date.
Timestamps are set to the start of the picked day in the default time zone.

Author:
harald
  • Constructor Details

    • DateLocalDateTranslator

      public DateLocalDateTranslator(FxComponent component)
      Creates a date to local date translator.
      Parameters:
      component - the component
  • Method Details

    • toViewFunction

      public Function<Date, LocalDate> toViewFunction()
      Description copied from interface: ValueTranslator
      Function to translate a model value to a view value.
      Returns:
      the function
    • toModelFunction

      public Function<LocalDate, Date> toModelFunction()
      Description copied from interface: ValueTranslator
      Function to translate a view value to a model value.
      Returns:
      the function