org.springframework.format.number.money

## 类 Jsr354NumberFormatAnnotationFormatterFactory

- java.lang.Object
- - org.springframework.context.support.EmbeddedValueResolutionSupport
  - - org.springframework.format.number.money.Jsr354NumberFormatAnnotationFormatterFactory

- 所有已实现的接口:
    org.springframework.beans.factory.Aware, EmbeddedValueResolverAware, AnnotationFormatterFactory<NumberFormat>

      public class Jsr354NumberFormatAnnotationFormatterFactory
      extends EmbeddedValueResolutionSupport
      implements AnnotationFormatterFactory<NumberFormat>

  Formats `MonetaryAmount` fields annotated with Spring's common `NumberFormat` annotation.
  从以下版本开始:
    4.2
  作者:
    Juergen Hoeller
  另请参阅:
    `NumberFormat`

- - ### 构造器概要

    构造器
    构造器和说明
    `Jsr354NumberFormatAnnotationFormatterFactory()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `Set<Class<?>>` | `getFieldTypes()` The types of fields that may be annotated with the <A> annotation.
    `Parser<javax.money.MonetaryAmount>` | `getParser(NumberFormat annotation, Class<?> fieldType)` Get the Parser to parse a submitted value for a field of `fieldType` annotated with `annotation`.
    `Printer<javax.money.MonetaryAmount>` | `getPrinter(NumberFormat annotation, Class<?> fieldType)` Get the Printer to print the value of a field of `fieldType` annotated with `annotation`.

    - ### 从类继承的方法 org.springframework.context.support.EmbeddedValueResolutionSupport

      `resolveEmbeddedValue, setEmbeddedValueResolver`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### Jsr354NumberFormatAnnotationFormatterFactory

          public Jsr354NumberFormatAnnotationFormatterFactory()

  - ### 方法详细资料

    - #### getFieldTypes

          public Set<Class<?>> getFieldTypes()

      从接口复制的说明: `AnnotationFormatterFactory`
      The types of fields that may be annotated with the <A> annotation.
      指定者:
        `getFieldTypes` 在接口中 `AnnotationFormatterFactory<NumberFormat>`

    - #### getPrinter

          public Printer<javax.money.MonetaryAmount> getPrinter(NumberFormat annotation,
                                                                Class<?> fieldType)

      从接口复制的说明: `AnnotationFormatterFactory`
      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.

      指定者:
        `getPrinter` 在接口中 `AnnotationFormatterFactory<NumberFormat>`
      参数:
        `annotation` - the annotation instance
        `fieldType` - the type of field that was annotated
      返回:
        the printer

    - #### getParser

          public Parser<javax.money.MonetaryAmount> getParser(NumberFormat annotation,
                                                              Class<?> fieldType)

      从接口复制的说明: `AnnotationFormatterFactory`
      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.

      指定者:
        `getParser` 在接口中 `AnnotationFormatterFactory<NumberFormat>`
      参数:
        `annotation` - the annotation instance
        `fieldType` - the type of field that was annotated
      返回:
        the parser