类 Jsr310DateTimeFormatAnnotationFormatterFactory
- java.lang.Object
- org.springframework.context.support.EmbeddedValueResolutionSupport
- org.springframework.format.datetime.standard.Jsr310DateTimeFormatAnnotationFormatterFactory
public class Jsr310DateTimeFormatAnnotationFormatterFactory extends EmbeddedValueResolutionSupport implements AnnotationFormatterFactory<DateTimeFormat>
Formats fields annotated with theDateTimeFormat
annotation using the JSR-310java.time
package in JDK 8.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
DateTimeFormat
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Set<Class<?>>
getFieldTypes()
The types of fields that may be annotated with the <A> annotation.protected DateTimeFormatter
getFormatter(DateTimeFormat annotation, Class<?> fieldType)
Factory method used to create aDateTimeFormatter
.Parser<?>
getParser(DateTimeFormat annotation, Class<?> fieldType)
Get the Parser to parse a submitted value for a field offieldType
annotated withannotation
.Printer<?>
getPrinter(DateTimeFormat annotation, Class<?> fieldType)
Get the Printer to print the value of a field offieldType
annotated withannotation
.从类继承的方法 org.springframework.context.support.EmbeddedValueResolutionSupport
resolveEmbeddedValue, setEmbeddedValueResolver
构造器详细资料
Jsr310DateTimeFormatAnnotationFormatterFactory
public Jsr310DateTimeFormatAnnotationFormatterFactory()
方法详细资料
getFieldTypes
public final Set<Class<?>> getFieldTypes()
从接口复制的说明:AnnotationFormatterFactory
The types of fields that may be annotated with the <A> annotation.
getPrinter
public Printer<?> getPrinter(DateTimeFormat annotation, Class<?> fieldType)
从接口复制的说明:AnnotationFormatterFactory
Get the Printer to print the value of a field offieldType
annotated withannotation
.If the type T the printer accepts is not assignable to
fieldType
, a coercion fromfieldType
to T will be attempted before the Printer is invoked.- 指定者:
getPrinter
在接口中AnnotationFormatterFactory<DateTimeFormat>
- 参数:
annotation
- the annotation instancefieldType
- the type of field that was annotated- 返回:
- the printer
getParser
public Parser<?> getParser(DateTimeFormat annotation, Class<?> fieldType)
从接口复制的说明:AnnotationFormatterFactory
Get the Parser to parse a submitted value for a field offieldType
annotated withannotation
.If the object the parser returns is not assignable to
fieldType
, a coercion tofieldType
will be attempted before the field is set.- 指定者:
getParser
在接口中AnnotationFormatterFactory<DateTimeFormat>
- 参数:
annotation
- the annotation instancefieldType
- the type of field that was annotated- 返回:
- the parser
getFormatter
protected DateTimeFormatter getFormatter(DateTimeFormat annotation, Class<?> fieldType)
Factory method used to create aDateTimeFormatter
.- 参数:
annotation
- the format annotation for the fieldfieldType
- the declared type of the field- 返回:
- a
DateTimeFormatter
instance