Class CustomDateIntervalConverter

java.lang.Object
io.jmix.flowuidata.dateinterval.converter.CustomDateIntervalConverter
All Implemented Interfaces:
DateIntervalConverter

@Component("flowui_CustomDateIntervalConverter") public class CustomDateIntervalConverter extends Object implements DateIntervalConverter
Converter for parsing and formatting CustomDateInterval in a specific string representation.
  • Field Details

    • CUSTOM_PATTERN

      public static final Pattern CUSTOM_PATTERN
    • TYPE_PATTERN

      public static final Pattern TYPE_PATTERN
    • PROP_PATTERN

      public static final Pattern PROP_PATTERN
    • START_PATTERN

      public static final Pattern START_PATTERN
    • END_PATTERN

      public static final Pattern END_PATTERN
    • messages

      protected Messages messages
    • datatypeRegistry

      protected DatatypeRegistry datatypeRegistry
    • dateTimeTransformations

      protected DateTimeTransformations dateTimeTransformations
    • localDateDatatype

      protected Datatype<LocalDate> localDateDatatype
    • datatypeFormatter

      protected DatatypeFormatter datatypeFormatter
  • Constructor Details

    • CustomDateIntervalConverter

      public CustomDateIntervalConverter()
  • Method Details

    • setMessages

      @Autowired public void setMessages(Messages messages)
    • setDatatypeRegistry

      @Autowired public void setDatatypeRegistry(DatatypeRegistry datatypeRegistry)
    • setDateTimeTransformations

      @Autowired public void setDateTimeTransformations(DateTimeTransformations dateTimeTransformations)
    • setDatatypeFormatter

      @Autowired public void setDatatypeFormatter(DatatypeFormatter datatypeFormatter)
    • parse

      @Nullable public BaseDateInterval parse(String dateInterval)
      Description copied from interface: DateIntervalConverter
      Parses string presentation of date interval to BaseDateInterval.
      Specified by:
      parse in interface DateIntervalConverter
      Parameters:
      dateInterval - string presentation of date interval
      Returns:
      configured date interval or null if input parameters is null or empty.
    • format

      public String format(BaseDateInterval dateInterval)
      Description copied from interface: DateIntervalConverter
      Formats date interval to string presentation.
      Specified by:
      format in interface DateIntervalConverter
      Parameters:
      dateInterval - date interval instance
      Returns:
      raw presentation of date interval
    • getLocalizedValue

      @Nullable public String getLocalizedValue(@Nullable BaseDateInterval dateInterval)
      Description copied from interface: DateIntervalConverter
      Formats date interval and gets localized value.
      Specified by:
      getLocalizedValue in interface DateIntervalConverter
      Parameters:
      dateInterval - date interval instance
      Returns:
      localized value
    • matches

      public boolean matches(String dateInterval)
      Description copied from interface: DateIntervalConverter
      Checks that provided date interval matches with converter's value pattern.
      Specified by:
      matches in interface DateIntervalConverter
      Parameters:
      dateInterval - string presentation of date interval
      Returns:
      true if provided data interval matches with the value pattern of the converter, false otherwise
    • supports

      public boolean supports(BaseDateInterval.Type type)
      Specified by:
      supports in interface DateIntervalConverter
      Parameters:
      type - date interval type
      Returns:
      true if converter supports the given type, false otherwise