Package play.data.format
Class Formats.AnnotationDateFormatter
java.lang.Object
play.data.format.Formatters.AnnotationFormatter<Formats.DateTime,Date>
play.data.format.Formats.AnnotationDateFormatter
- Enclosing class:
- Formats
public static class Formats.AnnotationDateFormatter
extends Formatters.AnnotationFormatter<Formats.DateTime,Date>
Annotation formatter, triggered by the
@DateTime annotation.-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationDateFormatter(MessagesApi messagesApi) Creates an annotation date formatter. -
Method Summary
Modifier and TypeMethodDescriptionparse(Formats.DateTime annotation, String text, Locale locale) Binds the field - constructs a concrete value from submitted data.print(Formats.DateTime annotation, Date value, Locale locale) Unbinds this field - converts a concrete value to plain string
-
Constructor Details
-
AnnotationDateFormatter
Creates an annotation date formatter.- Parameters:
messagesApi- messages to look up the pattern
-
-
Method Details
-
parse
Binds the field - constructs a concrete value from submitted data.- Specified by:
parsein classFormatters.AnnotationFormatter<Formats.DateTime,Date> - Parameters:
annotation- the annotation that triggered this formattertext- the field textlocale- the currentLocale- Returns:
- a new value
- Throws:
ParseException- when the text could not be parsed
-
print
Unbinds this field - converts a concrete value to plain string- Specified by:
printin classFormatters.AnnotationFormatter<Formats.DateTime,Date> - Parameters:
annotation- the annotation that triggered this formattervalue- the value to unbindlocale- the currentLocale- Returns:
- printable version of the value
-