play.data.format
Class Formatters.SimpleFormatter<T>

java.lang.Object
  extended by play.data.format.Formatters.SimpleFormatter<T>
Direct Known Subclasses:
Formats.DateFormatter
Enclosing class:
Formatters

public abstract static class Formatters.SimpleFormatter<T>
extends java.lang.Object

Super-type for custom simple formatters.


Constructor Summary
Formatters.SimpleFormatter()
           
 
Method Summary
abstract  T parse(java.lang.String text, java.util.Locale locale)
          Binds the field - constructs a concrete value from submitted data.
abstract  java.lang.String print(T t, java.util.Locale locale)
          Unbinds this field - transforms 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

Formatters.SimpleFormatter

public Formatters.SimpleFormatter()
Method Detail

parse

public abstract T parse(java.lang.String text,
                        java.util.Locale locale)
                 throws java.text.ParseException
Binds the field - constructs a concrete value from submitted data.

Parameters:
text - the field text
locale - the current Locale
Returns:
a new value
Throws:
java.text.ParseException

print

public abstract java.lang.String print(T t,
                                       java.util.Locale locale)
Unbinds this field - transforms a concrete value to plain string.

Parameters:
t - the value to unbind
locale - the current Locale
Returns:
printable version of the value