class DateFormatValidatorFactory {

    public static DateFormatValidator forTypes(final Type sourceType, final Type targetType) {
        DateFormatValidator dateFormatValidator;

        if ( isJavaUtilDateSupposed( sourceType, targetType ) ) {
            dateFormatValidator = new SimpleDateFormatValidator();
        }
        else if ( isXmlGregorianCalendarSupposedToBeMapped( sourceType, targetType ) ) {
            dateFormatValidator = new SimpleDateFormatValidator();
        }
        else if ( isJava8DateTimeSupposed( sourceType, targetType ) ) {
            dateFormatValidator = new JavaDateTimeDateFormatValidator();
        }
        else if ( isJodaDateTimeSupposed( sourceType, targetType ) ) {
            dateFormatValidator = new JodaTimeDateFormatValidator();
        }
        else {
            dateFormatValidator = new DateFormatValidator() {
                @Override
                public DateFormatValidationResult validate(String dateFormat) {
                    return new DateFormatValidationResult( true, Message.GENERAL_UNSUPPORTED_DATE_FORMAT_CHECK,
                                                           sourceType, targetType );
                }
            };
        }
        return dateFormatValidator;

    }

    private  DateFormatValidatorFactory();

}