Class DefaultNumberFormatFactory
java.lang.Object
org.springframework.binding.format.AbstractNumberFormatFactory
org.springframework.binding.format.DefaultNumberFormatFactory
- All Implemented Interfaces:
NumberFormatFactory
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected NumberFormat
getNumberFormat
(Locale locale) Subclasses should override to create the new NumberFormat instance.The pattern to use to format number values.void
setPattern
(String pattern) Sets the pattern for formatting numbers.Methods inherited from class org.springframework.binding.format.AbstractNumberFormatFactory
getLocale, getNumberFormat, setLocale
-
Constructor Details
-
DefaultNumberFormatFactory
public DefaultNumberFormatFactory()
-
-
Method Details
-
getPattern
The pattern to use to format number values. If not specified, the default DecimalFormat pattern is used.- Returns:
- the date formatting pattern
-
setPattern
Sets the pattern for formatting numbers.- Parameters:
pattern
- the format pattern- See Also:
-
getNumberFormat
Description copied from class:AbstractNumberFormatFactory
Subclasses should override to create the new NumberFormat instance.- Specified by:
getNumberFormat
in classAbstractNumberFormatFactory
- Parameters:
locale
- the locale to use- Returns:
- the number format
-