play.data.format
Class Formats.AnnotationDateFormatter
java.lang.Object
play.data.format.Formatters.AnnotationFormatter<Formats.DateTime,java.util.Date>
play.data.format.Formats.AnnotationDateFormatter
- Enclosing class:
- Formats
public static class Formats.AnnotationDateFormatter
- extends Formatters.AnnotationFormatter<Formats.DateTime,java.util.Date>
Annotation formatter, triggered by the @DateTime
annotation.
Method Summary |
java.util.Date |
parse(Formats.DateTime annotation,
java.lang.String text,
java.util.Locale locale)
Binds the field - constructs a concrete value from submitted data. |
java.lang.String |
print(Formats.DateTime annotation,
java.util.Date value,
java.util.Locale locale)
Unbinds this field - converts a concrete value to plain string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Formats.AnnotationDateFormatter
public Formats.AnnotationDateFormatter()
parse
public java.util.Date parse(Formats.DateTime annotation,
java.lang.String text,
java.util.Locale locale)
throws java.text.ParseException
- Binds the field - constructs a concrete value from submitted data.
- Specified by:
parse
in class Formatters.AnnotationFormatter<Formats.DateTime,java.util.Date>
- Parameters:
annotation
- the annotation that trigerred this formattertext
- the field textlocale
- the current Locale
- Returns:
- a new value
- Throws:
java.text.ParseException
print
public java.lang.String print(Formats.DateTime annotation,
java.util.Date value,
java.util.Locale locale)
- Unbinds this field - converts a concrete value to plain string
- Specified by:
print
in class Formatters.AnnotationFormatter<Formats.DateTime,java.util.Date>
- Parameters:
annotation
- the annotation that trigerred this formattervalue
- the value to unbindlocale
- the current Locale
- Returns:
- printable version of the value