com.github.fge.jsonschema.format.helpers
Class AbstractDateFormatAttribute

java.lang.Object
  extended by com.github.fge.jsonschema.format.AbstractFormatAttribute
      extended by 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!


Constructor Summary
protected AbstractDateFormatAttribute(String fmt, String format)
           
 
Method Summary
protected abstract  org.joda.time.format.DateTimeFormatter getFormatter()
           
 void validate(ProcessingReport report, MessageBundle bundle, FullData data)
          Validate the instance against this format attribute
 
Methods inherited from class com.github.fge.jsonschema.format.AbstractFormatAttribute
newMsg, supportedTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDateFormatAttribute

protected AbstractDateFormatAttribute(String fmt,
                                      String format)
Method Detail

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 use
bundle - the message bundle to use
data - the validation data
Throws:
ProcessingException - an exception occurs (normally, never for a format attribute)