public static class Formats.AnnotationDateFormatter extends Formatters.AnnotationFormatter<Formats.DateTime,Date>
@DateTime
annotation.Constructor and Description |
---|
AnnotationDateFormatter(MessagesApi messagesApi)
Creates an annotation date formatter.
|
Modifier and Type | Method and Description |
---|---|
Date |
parse(Formats.DateTime annotation,
String text,
Locale locale)
Binds the field - constructs a concrete value from submitted data.
|
String |
print(Formats.DateTime annotation,
Date value,
Locale locale)
Unbinds this field - converts a concrete value to plain string
|
public AnnotationDateFormatter(MessagesApi messagesApi)
messagesApi
- messages to look up the patternpublic Date parse(Formats.DateTime annotation, String text, Locale locale) throws ParseException
parse
in class Formatters.AnnotationFormatter<Formats.DateTime,Date>
annotation
- the annotation that triggered this formattertext
- the field textlocale
- the current Locale
ParseException
- when the text could not be parsedpublic String print(Formats.DateTime annotation, Date value, Locale locale)
print
in class Formatters.AnnotationFormatter<Formats.DateTime,Date>
annotation
- the annotation that triggered this formattervalue
- the value to unbindlocale
- the current Locale