Top Description Methods
org.springframework.format

public Interface AnnotationFormatterFactory<A extends Annotation>

Known Direct Implementers
org.springframework.format.datetime.DateTimeFormatAnnotationFormatterFactory, org.springframework.format.datetime.standard.Jsr310DateTimeFormatAnnotationFormatterFactory, org.springframework.format.number.NumberFormatAnnotationFormatterFactory, org.springframework.format.number.money.Jsr354NumberFormatAnnotationFormatterFactory
Type Parameters
<A>
the annotation type that should trigger formatting
Imports
java.lang.annotation.Annotation, java.util.Set

A factory that creates formatters to format values of fields annotated with a particular Annotation.

For example, a DateTimeFormatAnnotationFormatterFactory might create a formatter that formats Date values set on fields annotated with @DateTimeFormat.

Author
Keith Donald
Since
3.0

Method Summary

Modifier and TypeMethod and Description
public Set<Class<?>>
getFieldTypes()

The types of fields that may be annotated with the <A> annotation.

public Parser<?>

Returns:

the parser
getParser
(A
the annotation instance
annotation
,
Class<?>
the type of field that was annotated
fieldType
)

Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.

public Printer<?>

Returns:

the printer
getPrinter
(A
the annotation instance
annotation
,
Class<?>
the type of field that was annotated
fieldType
)

Get the Printer to print the value of a field of fieldType annotated with annotation.

Method Detail

getFieldTypesback to summary
public Set<Class<?>> getFieldTypes()

The types of fields that may be annotated with the <A> annotation.

getParserback to summary
public Parser<?> getParser(A annotation, Class<?> fieldType)

Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.

If the object the parser returns is not assignable to fieldType, a coercion to fieldType will be attempted before the field is set.

Parameters
annotation:A

the annotation instance

fieldType:Class<?>

the type of field that was annotated

Returns:Parser<?>

the parser

getPrinterback to summary
public Printer<?> getPrinter(A annotation, Class<?> fieldType)

Get the Printer to print the value of a field of fieldType annotated with annotation.

If the type T the printer accepts is not assignable to fieldType, a coercion from fieldType to T will be attempted before the Printer is invoked.

Parameters
annotation:A

the annotation instance

fieldType:Class<?>

the type of field that was annotated

Returns:Printer<?>

the printer