play.data.format
Class Formats.AnnotationNonEmptyFormatter

java.lang.Object
  extended by play.data.format.Formatters.AnnotationFormatter<Formats.NonEmpty,java.lang.String>
      extended by play.data.format.Formats.AnnotationNonEmptyFormatter
Enclosing class:
Formats

public static class Formats.AnnotationNonEmptyFormatter
extends Formatters.AnnotationFormatter<Formats.NonEmpty,java.lang.String>

Annotation formatter, triggered by the @NonEmpty annotation.


Constructor Summary
Formats.AnnotationNonEmptyFormatter()
           
 
Method Summary
 java.lang.String parse(Formats.NonEmpty annotation, java.lang.String text, java.util.Locale locale)
          Binds the field - constructs a concrete value from submitted data.
 java.lang.String print(Formats.NonEmpty annotation, java.lang.String 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.AnnotationNonEmptyFormatter

public Formats.AnnotationNonEmptyFormatter()
Method Detail

parse

public java.lang.String parse(Formats.NonEmpty 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.NonEmpty,java.lang.String>
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.NonEmpty annotation,
                              java.lang.String value,
                              java.util.Locale locale)
Unbinds this field - converts a concrete value to plain string

Specified by:
print in class Formatters.AnnotationFormatter<Formats.NonEmpty,java.lang.String>
Parameters:
annotation - the annotation that trigerred this formatter
value - the value to unbind
locale - the current Locale
Returns:
printable version of the value