Top Description Fields Constructors Methods
org.springframework.format.datetime

public Class DateTimeFormatAnnotationFormatterFactory

extends EmbeddedValueResolutionSupport
implements AnnotationFormatterFactory<DateTimeFormat>
Class Inheritance
All Implemented Interfaces
org.springframework.format.AnnotationFormatterFactory
Imports
java.util.ArrayList, .Calendar, .Date, .List, .Set, org.springframework.context.support.EmbeddedValueResolutionSupport, org.springframework.format.AnnotationFormatterFactory, .Formatter, .Parser, .Printer, org.springframework.format.annotation.DateTimeFormat, org.springframework.util.StringUtils

Formats fields annotated with the DateTimeFormat annotation using a DateFormatter.
Authors
Phillip Webb, Sam Brannen
Since
3.2

Field Summary

Modifier and TypeField and Description
private static final Set<Class<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.springframework.format.AnnotationFormatterFactory.getFieldTypes.

The types of fields that may be annotated with the <A> annotation.
protected Formatter<Date>
getFormatter(DateTimeFormat annotation, Class<?> fieldType)

public Parser<?>
getParser(DateTimeFormat
the annotation instance
annotation
,
Class<?>
the type of field that was annotated
fieldType
)

Implements org.springframework.format.AnnotationFormatterFactory.getParser.

Get the Parser to parse a submitted value for a field of fieldType annotated with annotation.
public Printer<?>
getPrinter(DateTimeFormat
the annotation instance
annotation
,
Class<?>
the type of field that was annotated
fieldType
)

Implements org.springframework.format.AnnotationFormatterFactory.getPrinter.

Get the Printer to print the value of a field of fieldType annotated with annotation.
Inherited from org.springframework.context.support.EmbeddedValueResolutionSupport:
resolveEmbeddedValuesetEmbeddedValueResolver

Field Detail

FIELD_TYPESback to summary
private static final Set<Class<?>> FIELD_TYPES

Constructor Detail

DateTimeFormatAnnotationFormatterFactoryback to summary
public DateTimeFormatAnnotationFormatterFactory()

Method Detail

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

Implements org.springframework.format.AnnotationFormatterFactory.getFieldTypes.

Doc from org.springframework.format.AnnotationFormatterFactory.getFieldTypes.

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

Annotations
@Override
getFormatterback to summary
protected Formatter<Date> getFormatter(DateTimeFormat annotation, Class<?> fieldType)
getParserback to summary
public Parser<?> getParser(DateTimeFormat annotation, Class<?> fieldType)

Implements org.springframework.format.AnnotationFormatterFactory.getParser.

Doc from org.springframework.format.AnnotationFormatterFactory.getParser.

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:DateTimeFormat

the annotation instance

fieldType:Class<?>

the type of field that was annotated

Returns:Parser<?>

the parser

Annotations
@Override
getPrinterback to summary
public Printer<?> getPrinter(DateTimeFormat annotation, Class<?> fieldType)

Implements org.springframework.format.AnnotationFormatterFactory.getPrinter.

Doc from org.springframework.format.AnnotationFormatterFactory.getPrinter.

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:DateTimeFormat

the annotation instance

fieldType:Class<?>

the type of field that was annotated

Returns:Printer<?>

the printer

Annotations
@Override