org.springframework.binding.format
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:
NumberFormat
,
DecimalFormat
Method Summary |
protected java.text.NumberFormat |
getNumberFormat(java.util.Locale locale)
Subclasses should override to create the new NumberFormat instance. |
java.lang.String |
getPattern()
The pattern to use to format number values. |
void |
setPattern(java.lang.String pattern)
Sets the pattern for formatting numbers. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultNumberFormatFactory
public DefaultNumberFormatFactory()
getPattern
public java.lang.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(java.lang.String pattern)
- Sets the pattern for formatting numbers.
- Parameters:
pattern
- the format pattern- See Also:
DecimalFormat
getNumberFormat
protected java.text.NumberFormat getNumberFormat(java.util.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