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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe locale to use in formatting number values.final NumberFormatFactory method that returns a fully-configuredNumberFormatinstance to use to format an object for display.protected abstract NumberFormatgetNumberFormat(Locale locale) Subclasses should override to create the new NumberFormat instance.voidSets 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:NumberFormatFactoryFactory method that returns a fully-configuredNumberFormatinstance to use to format an object for display.- Specified by:
getNumberFormatin 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
-