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:
BrowserTool
,DateTool
,MathTool
,NumberTool
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 String
The default format to be used when none is specified.private String
static final String
The key used for specifying a default format via tool configuration.Fields inherited from class org.apache.velocity.tools.generic.LocaleConfig
DEFAULT_LOCALE
Fields inherited from class org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.velocity.tools.generic.LocaleConfig
getLocale, setLocale
Methods inherited from class org.apache.velocity.tools.generic.SafeConfig
configure, 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:
-
format
-
-
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:
configure
in classLocaleConfig
-
getFormat
This returns the configured default format for this tool.- Returns:
- the default
String
-
setFormat
Sets the default format for this instance.
-