Class FormatConfig
java.lang.Object
org.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.LocaleConfig
org.apache.velocity.tools.generic.FormatConfig
- Direct Known Subclasses:
DateTool, MathTool, NumberTool, ValueParser
Implements common logic and constants for tools which allow their
default format to be configured.
- Since:
- VelocityTools 2.0
- Author:
- Nathan Bubna
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default format to be used when none is specified.static final StringThe key used for specifying a default format via tool configuration.Fields inherited from class LocaleConfig
DEFAULT_LOCALEFields inherited from class SafeConfig
LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class LocaleConfig
getLocale, setLocale, toLocaleMethods inherited from class SafeConfig
configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig, setSafeMode
-
Field Details
-
DEFAULT_FORMAT
The default format to be used when none is specified.- See Also:
-
FORMAT_KEY
The key used for specifying a default format via tool configuration.- See Also:
-
-
Constructor Details
-
FormatConfig
public FormatConfig()
-
-
Method Details
-
configure
Does the actual configuration. This is protected, so subclasses may share the same ValueParser and call configure at any time, while preventing templates from doing so when configure(Map) is locked.- Overrides:
configurein classLocaleConfig- Parameters:
values- configuration values
-
getFormat
-
setFormat
Sets the default format for this instance.- Parameters:
format- default format
-