Class LocaleConfig
- java.lang.Object
-
- org.apache.velocity.tools.generic.SafeConfig
-
- org.apache.velocity.tools.generic.LocaleConfig
-
- Direct Known Subclasses:
ConversionTool,DisplayTool,FormatConfig,ResourceTool
public class LocaleConfig extends SafeConfig
Implements common logic and constants for tools which allow their defaultLocaleto be configured.- Since:
- VelocityTools 2.0
- Author:
- Nathan Bubna
-
-
Field Summary
Fields Modifier and Type Field Description static LocaleDEFAULT_LOCALEThe defaultLocaleto be used when none is specified.-
Fields inherited from class org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY
-
-
Constructor Summary
Constructors Constructor Description LocaleConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(ValueParser values)Does the actual configuration.LocalegetLocale()This returns the configured defaultLocalefor this tool.protected voidsetLocale(Locale locale)Sets the default locale for this instance.-
Methods inherited from class org.apache.velocity.tools.generic.SafeConfig
configure, isConfigLocked, isSafeMode, setLockConfig, setSafeMode
-
-
-
-
Method Detail
-
configure
protected void configure(ValueParser values)
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 classSafeConfig
-
getLocale
public Locale getLocale()
This returns the configured defaultLocalefor this tool.- Returns:
- the default
Locale
-
setLocale
protected void setLocale(Locale locale)
Sets the default locale for this instance.
-
-