Class DefaultNumberFormatFactory

java.lang.Object
org.springframework.binding.format.AbstractNumberFormatFactory
org.springframework.binding.format.DefaultNumberFormatFactory
All Implemented Interfaces:
NumberFormatFactory

public class DefaultNumberFormatFactory extends AbstractNumberFormatFactory
Works with a general purpose DecimalFormat instance returned by calling NumberFormat.getInstance(Locale) by default. This instance supports parsing any number type generally and will not perform special type-specific logic such as rounding or truncation.
Author:
Keith Donald
See Also:
  • Constructor Details

    • DefaultNumberFormatFactory

      public DefaultNumberFormatFactory()
  • Method Details

    • getPattern

      public String getPattern()
      The pattern to use to format number values. If not specified, the default DecimalFormat pattern is used.
      Returns:
      the date formatting pattern
    • setPattern

      public void setPattern(String pattern)
      Sets the pattern for formatting numbers.
      Parameters:
      pattern - the format pattern
      See Also:
    • getNumberFormat

      protected NumberFormat getNumberFormat(Locale locale)
      Description copied from class: AbstractNumberFormatFactory
      Subclasses should override to create the new NumberFormat instance.
      Specified by:
      getNumberFormat in class AbstractNumberFormatFactory
      Parameters:
      locale - the locale to use
      Returns:
      the number format