Package play.data.format
Class Formatters.SimpleFormatter<T>
- Object
-
- play.data.format.Formatters.SimpleFormatter<T>
-
- Type Parameters:
T
- the type that this formatter will parse and print
- Direct Known Subclasses:
Formats.DateFormatter
- Enclosing class:
- Formatters
public abstract static class Formatters.SimpleFormatter<T> extends Object
Super-type for custom simple formatters.
-
-
Constructor Summary
Constructors Constructor Description SimpleFormatter()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract T
parse(String text, Locale locale)
Binds the field - constructs a concrete value from submitted data.abstract String
print(T t, Locale locale)
Unbinds this field - transforms a concrete value to plain string.
-
-
-
Method Detail
-
parse
public abstract T parse(String text, Locale locale) throws ParseException
Binds the field - constructs a concrete value from submitted data.- Parameters:
text
- the field textlocale
- the current Locale- Returns:
- a new value
- Throws:
ParseException
- if the text could not be parsed into T
-
-