play.data.format
Class Formats.AnnotationDateFormatter

java.lang.Object
  extended by play.data.format.Formatters.AnnotationFormatter<Formats.DateTime,java.util.Date>
      extended by 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.


Constructor Summary
Formats.AnnotationDateFormatter()
           
 
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
 

Constructor Detail

Formats.AnnotationDateFormatter

public Formats.AnnotationDateFormatter()
Method Detail

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 formatter
text - the field text
locale - 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 formatter
value - the value to unbind
locale - the current Locale
Returns:
printable version of the value