public abstract class AbstractDateFormatSpecifier extends FormatSpecifier
Joda Time is used for
date and time parsing: it can handle all defined formats, and catches more
errors than the standard JDK's SimpleDateFormat does.
What's more, unlike SimpleDateFormat, Joda Time's
DateTimeFormatter is thread-safe!
| Modifier and Type | Field and Description |
|---|---|
private DateTimeFormatter |
dtf
The
DateTimeFormatter to use |
private String |
errmsg
The error message in case of validation failure
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDateFormatSpecifier(String fmt,
String desc)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkValue(String fmt,
ValidationContext ctx,
ValidationReport report,
JsonNode instance)
Abstract method implemented by all specifiers
|
newMsg, validateprivate final String errmsg
private final DateTimeFormatter dtf
DateTimeFormatter to usepublic final void checkValue(String fmt, ValidationContext ctx, ValidationReport report, JsonNode instance)
FormatSpecifierIt is only called if the value type is one expected by the
specifier, see FormatSpecifier.validate(String, ValidationContext,
ValidationReport, JsonNode).
checkValue in class FormatSpecifierfmt - the format specifier namectx - the validation contextreport - the validation reportinstance - the value to validateCopyright © 2012. All Rights Reserved.