类 NumberFormatAnnotationFormatterFactory
- java.lang.Object
- org.springframework.context.support.EmbeddedValueResolutionSupport
- org.springframework.format.number.NumberFormatAnnotationFormatterFactory
public class NumberFormatAnnotationFormatterFactory extends EmbeddedValueResolutionSupport implements AnnotationFormatterFactory<NumberFormat>
Formats fields annotated with theNumberFormat
annotation.- 从以下版本开始:
- 3.0
- 作者:
- Keith Donald, Juergen Hoeller
- 另请参阅:
NumberFormat
构造器概要
构造器 构造器 说明 NumberFormatAnnotationFormatterFactory()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Set<Class<?>>
getFieldTypes()
The types of fields that may be annotated with the <A> annotation.Parser<Number>
getParser(NumberFormat annotation, Class<?> fieldType)
Get the Parser to parse a submitted value for a field offieldType
annotated withannotation
.Printer<Number>
getPrinter(NumberFormat annotation, Class<?> fieldType)
Get the Printer to print the value of a field offieldType
annotated withannotation
.从类继承的方法 org.springframework.context.support.EmbeddedValueResolutionSupport
resolveEmbeddedValue, setEmbeddedValueResolver
构造器详细资料
NumberFormatAnnotationFormatterFactory
public NumberFormatAnnotationFormatterFactory()
方法详细资料
getFieldTypes
public Set<Class<?>> getFieldTypes()
从接口复制的说明:AnnotationFormatterFactory
The types of fields that may be annotated with the <A> annotation.
getPrinter
public Printer<Number> getPrinter(NumberFormat 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<NumberFormat>
- 参数:
annotation
- the annotation instancefieldType
- the type of field that was annotated- 返回:
- the printer
getParser
public Parser<Number> getParser(NumberFormat 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<NumberFormat>
- 参数:
annotation
- the annotation instancefieldType
- the type of field that was annotated- 返回:
- the parser