类 JodaDateTimeFormatAnnotationFormatterFactory
- java.lang.Object
- org.springframework.context.support.EmbeddedValueResolutionSupport
- org.springframework.format.datetime.joda.JodaDateTimeFormatAnnotationFormatterFactory
public class JodaDateTimeFormatAnnotationFormatterFactory extends EmbeddedValueResolutionSupport implements AnnotationFormatterFactory<DateTimeFormat>
Formats fields annotated with theDateTimeFormat
annotation using Joda-Time.NOTE: Spring's Joda-Time support requires Joda-Time 2.x, as of Spring 4.0.
- 从以下版本开始:
- 3.0
- 作者:
- Keith Donald, Juergen Hoeller
- 另请参阅:
DateTimeFormat
构造器概要
构造器 构造器 说明 JodaDateTimeFormatAnnotationFormatterFactory()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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
构造器详细资料
JodaDateTimeFormatAnnotationFormatterFactory
public JodaDateTimeFormatAnnotationFormatterFactory()
方法详细资料
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 type of field- 返回:
- a
DateTimeFormatter
instance - 从以下版本开始:
- 3.2