Class DateFormatValidatorFactory


  • final class DateFormatValidatorFactory
    extends java.lang.Object
    Factory for DateFormatValidator.

    Based on the types of source / target type a specific DateFormatValidator will be instantiated.

    • Joda Time
    • Java 8 Time and
    • java.util.Date
    are supported.

    • Field Detail

      • JAVA_TIME_FORMAT_DATE_TIME_FORMATTER

        private static final java.lang.String JAVA_TIME_FORMAT_DATE_TIME_FORMATTER
        See Also:
        Constant Field Values
      • ORG_JODA_TIME_FORMAT_DATE_TIME_FORMAT

        private static final java.lang.String ORG_JODA_TIME_FORMAT_DATE_TIME_FORMAT
        See Also:
        Constant Field Values
    • Constructor Detail

      • DateFormatValidatorFactory

        private DateFormatValidatorFactory()
    • Method Detail

      • forTypes

        public static DateFormatValidator forTypes​(Type sourceType,
                                                   Type targetType)
        Create a new DateFormatValidator based on source/target type of a type conversion. Theirs typenames will be compared against the supported types to determine a validator.
        Parameters:
        sourceType - The source type
        targetType - The target type
        Returns:
        a new DateFormatValidator
      • isXmlGregorianCalendarSupposedToBeMapped

        private static boolean isXmlGregorianCalendarSupposedToBeMapped​(Type sourceType,
                                                                        Type targetType)
      • isJodaDateTimeSupposed

        private static boolean isJodaDateTimeSupposed​(Type sourceType,
                                                      Type targetType)
      • isJava8DateTimeSupposed

        private static boolean isJava8DateTimeSupposed​(Type sourceType,
                                                       Type targetType)
      • isJavaUtilDateSupposed

        private static boolean isJavaUtilDateSupposed​(Type sourceType,
                                                      Type targetType)
      • typesEqualsOneOf

        private static boolean typesEqualsOneOf​(Type sourceType,
                                                Type targetType,
                                                java.lang.String... typeNames)
      • invalidDateFormat

        private static DateFormatValidationResult invalidDateFormat​(java.lang.String dateFormat,
                                                                    java.lang.Throwable e)