org.springframework.format.number

## 类 AbstractNumberFormatter

- java.lang.Object
- - org.springframework.format.number.AbstractNumberFormatter

- 所有已实现的接口:
    Formatter<Number>, Parser<Number>, Printer<Number>
  直接已知子类:
    CurrencyStyleFormatter, NumberStyleFormatter, PercentStyleFormatter

      public abstract class AbstractNumberFormatter
      extends Object
      implements Formatter<Number>

  Abstract formatter for Numbers, providing a `getNumberFormat(java.util.Locale)` template method.
  从以下版本开始:
    3.0
  作者:
    Juergen Hoeller, Keith Donald

- - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected abstract NumberFormat` | `getNumberFormat(Locale locale)` Obtain a concrete NumberFormat for the specified locale.
    `Number` | `parse(String text, Locale locale)` Parse a text String to produce a T.
    `String` | `print(Number number, Locale locale)` Print the object of type T for display.
    `void` | `setLenient(boolean lenient)` Specify whether or not parsing is to be lenient.

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

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

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

    - #### AbstractNumberFormatter

          public AbstractNumberFormatter()

  - ### 方法详细资料

    - #### setLenient

          public void setLenient(boolean lenient)

      Specify whether or not parsing is to be lenient. Default is false.

      With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly.

    - #### print

          public String print(Number number,
                              Locale locale)

      从接口复制的说明: `Printer`
      Print the object of type T for display.
      指定者:
        `print` 在接口中 `Printer<Number>`
      参数:
        `number` - the instance to print
        `locale` - the current user locale
      返回:
        the printed text string

    - #### parse

          public Number parse(String text,
                              Locale locale)
                       throws ParseException

      从接口复制的说明: `Parser`
      Parse a text String to produce a T.
      指定者:
        `parse` 在接口中 `Parser<Number>`
      参数:
        `text` - the text string
        `locale` - the current user locale
      返回:
        an instance of T
      抛出:
        `ParseException` - when a parse exception occurs in a java.text parsing library

    - #### getNumberFormat

          protected abstract NumberFormat getNumberFormat(Locale locale)

      Obtain a concrete NumberFormat for the specified locale.
      参数:
        `locale` - the current locale
      返回:
        the NumberFormat instance (never `null`)