Class Formatters.AnnotationFormatter<A extends Annotation,​T>

    • Constructor Detail

      • AnnotationFormatter

        public AnnotationFormatter()
    • Method Detail

      • parse

        public abstract T parse​(A annotation,
                                String text,
                                Locale locale)
                         throws ParseException
        Binds the field - constructs a concrete value from submitted data.
        Parameters:
        annotation - the annotation that triggered this formatter
        text - the field text
        locale - the current Locale
        Returns:
        a new value
        Throws:
        ParseException - when the text could not be parsed
      • print

        public abstract String print​(A annotation,
                                     T value,
                                     Locale locale)
        Unbind this field (ie. transform a concrete value to plain string)
        Parameters:
        annotation - the annotation that triggered this formatter.
        value - the value to unbind
        locale - the current Locale
        Returns:
        printable version of the value