Class DateFormatValidatorFactory
- java.lang.Object
-
- org.mapstruct.ap.internal.model.common.DateFormatValidatorFactory
-
final class DateFormatValidatorFactory extends java.lang.ObjectFactory forDateFormatValidator.Based on the types of source / target type a specific
DateFormatValidatorwill be instantiated.
- Joda Time
- Java 8 Time and
- java.util.Date
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDateFormatValidatorFactory.JavaDateTimeDateFormatValidatorprivate static classDateFormatValidatorFactory.JodaTimeDateFormatValidatorprivate static classDateFormatValidatorFactory.SimpleDateFormatValidator
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringFOR_PATTERNprivate static java.lang.StringJAVA_TIME_FORMAT_DATE_TIME_FORMATTERprivate static java.lang.StringJAVA_UTIL_DATEprivate static java.lang.StringOF_PATTERNprivate static java.lang.StringORG_JODA_TIME_FORMAT_DATE_TIME_FORMAT
-
Constructor Summary
Constructors Modifier Constructor Description privateDateFormatValidatorFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DateFormatValidatorforTypes(Type sourceType, Type targetType)Create a newDateFormatValidatorbased on source/target type of a type conversion.private static DateFormatValidationResultinvalidDateFormat(java.lang.String dateFormat, java.lang.Throwable e)private static booleanisJava8DateTimeSupposed(Type sourceType, Type targetType)private static booleanisJavaUtilDateSupposed(Type sourceType, Type targetType)private static booleanisJodaDateTimeSupposed(Type sourceType, Type targetType)private static booleanisXmlGregorianCalendarSupposedToBeMapped(Type sourceType, Type targetType)private static DateFormatValidationResultnoJodaOnClassPath()private static booleantypesEqualsOneOf(Type sourceType, Type targetType, java.lang.String... typeNames)private static DateFormatValidationResultvalidDateFormat(java.lang.String dateFormat)
-
-
-
Field Detail
-
JAVA_UTIL_DATE
private static final java.lang.String JAVA_UTIL_DATE
- See Also:
- Constant Field Values
-
JAVA_TIME_FORMAT_DATE_TIME_FORMATTER
private static final java.lang.String JAVA_TIME_FORMAT_DATE_TIME_FORMATTER
- See Also:
- Constant Field Values
-
OF_PATTERN
private static final java.lang.String OF_PATTERN
- 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
-
FOR_PATTERN
private static final java.lang.String FOR_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
forTypes
public static DateFormatValidator forTypes(Type sourceType, Type targetType)
Create a newDateFormatValidatorbased 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 typetargetType- 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)
-
validDateFormat
private static DateFormatValidationResult validDateFormat(java.lang.String dateFormat)
-
invalidDateFormat
private static DateFormatValidationResult invalidDateFormat(java.lang.String dateFormat, java.lang.Throwable e)
-
noJodaOnClassPath
private static DateFormatValidationResult noJodaOnClassPath()
-
-