fr.whimtrip.ext.jwhthtmltopojo.exception.DateParseException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of whimtrip-ext-htmltopojo Show documentation
Show all versions of whimtrip-ext-htmltopojo Show documentation
Fully featured highly pluggable and customizable Java html to pojo reflection converter
package fr.whimtrip.ext.jwhthtmltopojo.exception;
import fr.whimtrip.ext.jwhthtmltopojo.HtmlToPojoUtils;
import org.joda.time.DateTime;
import java.util.Date;
import java.util.Locale;
/**
*
* Part of project jwht-htmltopojo
*
*
* Thrown by {@link HtmlToPojoUtils#castValue(String, Class, String, Locale)} when
* the input pre-processed string cannot be converted into a proper {@link Date} /
* {@link DateTime} (or any other supported date field, see {@link HtmlToPojoUtils#isDate(Class)}).
*
* This is either caused by a pattern misuse, a locale and pattern problem or a bad
* string scrapping resulting in an unparsable Date.
*
*
* @author Louis-wht
* @since 1.0.0
*/
public class DateParseException extends ParseException {
/**
*
* @param value the pre-processed value that could not be parsed
* @param format the format of the date expected
* @param locale the locale of the date format expected
*/
public DateParseException(String value, String format, Locale locale) {
super(String.format(Locale.ENGLISH, "Cannot parse date %s with format: %s and locale: %s.", value, format, locale.toLanguageTag()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy