Class DateTimeConverter

  • All Implemented Interfaces:
    ConverterIfc

    public class DateTimeConverter
    extends java.lang.Object
    implements ConverterIfc
    Converter to convert to the DATE_TIME data type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canConvert​(java.lang.Object object)
      Checks, if a given object can be converted by this converter.
      EvaluationValue convert​(java.lang.Object object, ExpressionConfiguration configuration)
      Called to convert a previously checked data type.
      java.time.Instant parseDateTime​(java.lang.String value, java.time.ZoneId zoneId, java.util.List<java.time.format.DateTimeFormatter> formatters)
      Tries to parse a date-time string by trying out each format in the list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateTimeConverter

        public DateTimeConverter()
    • Method Detail

      • convert

        public EvaluationValue convert​(java.lang.Object object,
                                       ExpressionConfiguration configuration)
        Description copied from interface: ConverterIfc
        Called to convert a previously checked data type.
        Specified by:
        convert in interface ConverterIfc
        Parameters:
        object - The object to convert.
        configuration - The current expression configuration.
        Returns:
        The converted value.
      • parseDateTime

        public java.time.Instant parseDateTime​(java.lang.String value,
                                               java.time.ZoneId zoneId,
                                               java.util.List<java.time.format.DateTimeFormatter> formatters)
        Tries to parse a date-time string by trying out each format in the list. The first matching result is returned. If none of the formats can be used to parse the string, null is returned.
        Parameters:
        value - The string to parse.
        zoneId - The ZoneId to use for parsing.
        formatters - The list of formatters.
        Returns:
        A parsed Instant if parsing was successful, else null.
      • canConvert

        public boolean canConvert​(java.lang.Object object)
        Description copied from interface: ConverterIfc
        Checks, if a given object can be converted by this converter.
        Specified by:
        canConvert in interface ConverterIfc
        Parameters:
        object - The object to convert.
        Returns:
        true if the object can be converted, false otherwise.