Class AbstractNumberFormatFactory
java.lang.Object
org.springframework.binding.format.AbstractNumberFormatFactory
- All Implemented Interfaces:
NumberFormatFactory
- Direct Known Subclasses:
CurrencyNumberFormatFactory
,DefaultNumberFormatFactory
,IntegerNumberFormatFactory
,PercentNumberFormatFactory
Base class suitable for subclassing by most
NumberFormatFactory
implementations.- Author:
- Keith Donald
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe locale to use in formatting number values.final NumberFormat
Factory method that returns a fully-configuredNumberFormat
instance to use to format an object for display.protected abstract NumberFormat
getNumberFormat
(Locale locale) Subclasses should override to create the new NumberFormat instance.void
Sets the locale to use in formatting number values.
-
Constructor Details
-
AbstractNumberFormatFactory
public AbstractNumberFormatFactory()
-
-
Method Details
-
getLocale
The locale to use in formatting number values. If null, the locale associated with the current thread is used.- Returns:
- the locale
- See Also:
-
LocaleContextHolder.getLocale()
-
setLocale
Sets the locale to use in formatting number values.- Parameters:
locale
- the locale
-
getNumberFormat
Description copied from interface:NumberFormatFactory
Factory method that returns a fully-configuredNumberFormat
instance to use to format an object for display.- Specified by:
getNumberFormat
in interfaceNumberFormatFactory
- Returns:
- the number format
-
getNumberFormat
Subclasses should override to create the new NumberFormat instance.- Parameters:
locale
- the locale to use- Returns:
- the number format
-