Top Description Constructors Methods
org.springframework.format.number

public Class NumberFormatAnnotationFormatterFactory

extends EmbeddedValueResolutionSupport
implements AnnotationFormatterFactory<NumberFormat>
Class Inheritance
All Implemented Interfaces
org.springframework.format.AnnotationFormatterFactory
Imports
java.util.Set, org.springframework.context.support.EmbeddedValueResolutionSupport, org.springframework.format.AnnotationFormatterFactory, .Formatter, .Parser, .Printer, org.springframework.format.annotation.NumberFormat, .NumberFormat.Style, org.springframework.util.NumberUtils, .StringUtils

Formats fields annotated with the NumberFormat annotation.
Authors
Keith Donald, Juergen Hoeller
Since
3.0
See Also
NumberFormat

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.springframework.format.AnnotationFormatterFactory.getFieldTypes.

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

public Parser<Number>
getParser(NumberFormat
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<Number>
getPrinter(NumberFormat
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

Constructor Detail

NumberFormatAnnotationFormatterFactoryback to summary
public NumberFormatAnnotationFormatterFactory()

Method Detail

configureFormatterFromback to summary
private Formatter<Number> configureFormatterFrom(NumberFormat annotation)
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
getParserback to summary
public Parser<Number> getParser(NumberFormat 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:NumberFormat

the annotation instance

fieldType:Class<?>

the type of field that was annotated

Returns:Parser<Number>

the parser

Annotations
@Override
getPrinterback to summary
public Printer<Number> getPrinter(NumberFormat 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:NumberFormat

the annotation instance

fieldType:Class<?>

the type of field that was annotated

Returns:Printer<Number>

the printer

Annotations
@Override