play.data.format
Class Formatters.AnnotationFormatter<A extends java.lang.annotation.Annotation,T>
java.lang.Object
play.data.format.Formatters.AnnotationFormatter<A,T>
- Direct Known Subclasses:
- Formats.AnnotationDateFormatter, Formats.AnnotationNonEmptyFormatter
- Enclosing class:
- Formatters
public abstract static class Formatters.AnnotationFormatter<A extends java.lang.annotation.Annotation,T>
- extends java.lang.Object
Super-type for annotation-based formatters.
Method Summary |
abstract T |
parse(A annotation,
java.lang.String text,
java.util.Locale locale)
Binds the field - constructs a concrete value from submitted data. |
abstract java.lang.String |
print(A annotation,
T value,
java.util.Locale locale)
Unbind this field (ie. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Formatters.AnnotationFormatter
public Formatters.AnnotationFormatter()
parse
public abstract T parse(A annotation,
java.lang.String text,
java.util.Locale locale)
throws java.text.ParseException
- Binds the field - constructs a concrete value from submitted data.
- Parameters:
annotation
- the annotation that trigerred this formattertext
- the field textlocale
- the current Locale
- Returns:
- a new value
- Throws:
java.text.ParseException
print
public abstract java.lang.String print(A annotation,
T value,
java.util.Locale locale)
- Unbind this field (ie. transform a concrete value to plain string)
- Parameters:
annotation
- the annotation that trigerred this formatter.value
- the value to unbindlocale
- the current Locale
- Returns:
- printable version of the value