com.github.fge.jsonschema.format.helpers
Class AbstractDateFormatAttribute
java.lang.Object
com.github.fge.jsonschema.format.AbstractFormatAttribute
com.github.fge.jsonschema.format.helpers.AbstractDateFormatAttribute
- All Implemented Interfaces:
- FormatAttribute
- Direct Known Subclasses:
- DateAttribute, TimeAttribute
public abstract class AbstractDateFormatAttribute
- extends AbstractFormatAttribute
Abstract class for date/time related format attributes
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.
Furthermore (and more importantly), unlike SimpleDateFormat
, Joda
Time's DateTimeFormatter
is thread-safe!
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDateFormatAttribute
protected AbstractDateFormatAttribute(String fmt,
String format)
getFormatter
protected abstract org.joda.time.format.DateTimeFormatter getFormatter()
validate
public final void validate(ProcessingReport report,
MessageBundle bundle,
FullData data)
throws ProcessingException
- Description copied from interface:
FormatAttribute
- Validate the instance against this format attribute
- Parameters:
report
- the report to usebundle
- the message bundle to usedata
- the validation data
- Throws:
ProcessingException
- an exception occurs (normally, never for a
format attribute)