org.apache.velocity.tools.generic
Class LocaleConfig

java.lang.Object
  extended by org.apache.velocity.tools.generic.SafeConfig
      extended by 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 default Locale to be configured.

Since:
VelocityTools 2.0
Author:
Nathan Bubna

Field Summary
static java.util.Locale DEFAULT_LOCALE
          The default Locale to be used when none is specified.
private  java.util.Locale locale
           
 
Fields inherited from class org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY
 
Constructor Summary
LocaleConfig()
           
 
Method Summary
protected  void configure(ValueParser values)
          Does the actual configuration.
 java.util.Locale getLocale()
          This returns the configured default Locale for this tool.
protected  void setLocale(java.util.Locale locale)
          Sets the default locale for this instance.
 
Methods inherited from class org.apache.velocity.tools.generic.SafeConfig
configure, isConfigLocked, isSafeMode, setLockConfig, setSafeMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOCALE

public static final java.util.Locale DEFAULT_LOCALE
The default Locale to be used when none is specified.


locale

private java.util.Locale locale
Constructor Detail

LocaleConfig

public LocaleConfig()
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:
configure in class SafeConfig

getLocale

public java.util.Locale getLocale()
This returns the configured default Locale for this tool.

Returns:
the default Locale

setLocale

protected void setLocale(java.util.Locale locale)
Sets the default locale for this instance.



Copyright (c) 2003-2007 Apache Software Foundation