public abstract class TemplateNumberFormatFactory extends TemplateValueFormatFactory
TemplateNumberFormat). Usually a singleton (one-per-VM or one-per-
Configuration), and so must be thread-safe.
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns a formatter for the given parameters.
public abstract TemplateNumberFormat get(String params, Locale locale, Environment env) throws TemplateValueFormatException
The returned formatter can be a new instance or a reused (cached) instance. Note that
caches the returned instances, though that cache is lost with the
Environment (i.e., when the top-level
template execution ends), also it might flushes lot of entries if the locale or time zone is changed during
template execution. So caching on the factory level is still useful, unless creating the formatters is
params- The string that further describes how the format should look. For example, when the
"@fooBar 1, 2", then it will be
"@fooBar"selects the factory). The format of this string is up to the
null, often an empty string.
locale- The locale to format for. Not
null. The resulting format must be bound to this locale forever (i.e. locale changes in the
Environmentmust not be followed).
env- The runtime environment from which the formatting was called. This is mostly meant to be used for
TemplateValueFormatException- if any problem occurs while parsing/getting the format. Notable subclasses: