A converter for common number types such as integers and big decimals. Allows the configuration of an explicit number
pattern and locale.
Works with a general purpose
instance returned by calling
by default. This instance supports parsing any number type generally and
will not perform special type-specific logic such as rounding or truncation. Subclasses may override.
Will coerse parsed Numbers to the desired numberClass as necessary. If type-coersion results in an overflow
condition; for example, what can occur with a Long being coersed to a Short, an exception will be thrown.
Sets the factory that returns the
instance that will format numbers handled by this
numberFormatFactory the number format factory
If this Converter is "lenient" in parsing number strings. A lenient converter does not require that all
characters in the String be parsed successfully. Default is false.
Sets if this Converter should parse leniently.
lenient the lenient flag
Coerces the Number object returned by NumberFormat to the desired numberClass. Subclasses may override.
logger.warn("Pattern string cannot be determined because NumberFormat is not a DecimalFormat");