Package play.data.format
Class Formats.AnnotationNonEmptyFormatter
- Object
-
- play.data.format.Formatters.AnnotationFormatter<Formats.NonEmpty,String>
-
- play.data.format.Formats.AnnotationNonEmptyFormatter
-
- Enclosing class:
- Formats
public static class Formats.AnnotationNonEmptyFormatter extends Formatters.AnnotationFormatter<Formats.NonEmpty,String>
Annotation formatter, triggered by the@NonEmptyannotation.
-
-
Constructor Summary
Constructors Constructor Description AnnotationNonEmptyFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringparse(Formats.NonEmpty annotation, String text, Locale locale)Binds the field - constructs a concrete value from submitted data.Stringprint(Formats.NonEmpty annotation, String value, Locale locale)Unbinds this field - converts a concrete value to plain string
-
-
-
Method Detail
-
parse
public String parse(Formats.NonEmpty annotation, String text, Locale locale) throws ParseException
Binds the field - constructs a concrete value from submitted data.- Specified by:
parsein classFormatters.AnnotationFormatter<Formats.NonEmpty,String>- 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
public String print(Formats.NonEmpty annotation, String value, Locale locale)
Unbinds this field - converts a concrete value to plain string- Specified by:
printin classFormatters.AnnotationFormatter<Formats.NonEmpty,String>- Parameters:
annotation- the annotation that triggered this formattervalue- the value to unbindlocale- the currentLocale- Returns:
- printable version of the value
-
-