|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.LocaleBeanBase
public class LocaleBeanBase
Created by IntelliJ IDEA. User: DHD Date: 04-Sep-2006 Time: 16:34:48 To change this template use File | Settings | File Templates.
| Field Summary | |
|---|---|
private static MemoryTools.SimpleLRUMapAutoSizeForHitRate<java.util.Locale,java.util.Locale> |
_cacheCommonRealLocales
Private LRU cache from requested common locale to actual locale. |
private static java.util.concurrent.ConcurrentMap<java.util.Locale,java.util.ResourceBundle> |
_cachedCommonBundles
Cache mapping from the actual common bundle locale to the bundle itself. |
private static int |
EST_COMMON_BUNDLES
Estimated maximum number of real/used common resource bundles available; strictly positive. |
protected static java.util.Locale |
SAFE_LOCALE
``Safe'' locale is the one we want all activity to default to. |
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
private java.util.Locale |
userLocale
Locale retrieved by setRequest, or a safe locale value; never null. |
| Constructor Summary | |
|---|---|
LocaleBeanBase()
Public no-arg constructor for ease of use as a JavaBean. |
|
LocaleBeanBase(java.util.Locale l)
Public no-arg constructor for ease of use as a JavaBean. |
|
| Method Summary | |
|---|---|
static java.util.ResourceBundle |
getCommonResourceBundle(java.util.Locale l)
Gets the (properties-only) common resource bundle for the given locale. |
java.util.Locale |
getLocale()
Retrieve the current locale; never null. |
java.lang.String |
getLocalisedMessage(java.lang.String msgName)
Gets the appropriate localised message from the common set. |
java.lang.String |
getLocalisedMessage(java.lang.String msgName,
java.lang.Object... args)
Get localised message from the common set with embedded formatting to apply to its argument(s). |
private void |
readObject(java.io.ObjectInputStream in)
Deserialise. |
protected void |
setLocale(java.util.Locale l)
Mechanism by which deriving classes can set the locale (never null). |
java.lang.String |
toString()
Human-readable text representation; never null. |
void |
validateObject()
Validate fields/state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.Locale SAFE_LOCALE
private volatile java.util.Locale userLocale
private static final int EST_COMMON_BUNDLES
private static final java.util.concurrent.ConcurrentMap<java.util.Locale,java.util.ResourceBundle> _cachedCommonBundles
We expect to need relatively little write concurrency, even at start-up.
private static final MemoryTools.SimpleLRUMapAutoSizeForHitRate<java.util.Locale,java.util.Locale> _cacheCommonRealLocales
Sized on the basis that there may be up to 10s of 'alias' locales for each actual supported common bundle locale, eg many 'en'/'fr'/'de'/'es' variants requested for each actually supported.
private static final long serialVersionUID
| Constructor Detail |
|---|
public LocaleBeanBase()
public LocaleBeanBase(java.util.Locale l)
l - initial locale; never null| Method Detail |
|---|
public java.util.Locale getLocale()
protected void setLocale(java.util.Locale l)
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.util.ResourceBundle getCommonResourceBundle(java.util.Locale l)
Canonicalises the requested locale to a concrete available common bundle, and then looks that up to get the bundle.
Both parts of this lookup are cached.
Thread-safe and allows concurrency.
We do not search for class-based resources.
public java.lang.String getLocalisedMessage(java.lang.String msgName)
If the name is null, the result is null.
public java.lang.String getLocalisedMessage(java.lang.String msgName,
java.lang.Object... args)
If the name is null, the result is null.
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void validateObject()
throws java.io.InvalidObjectException
Barf if something bad is found. (Maybe allow some extra info in debug version.)
java.io.InvalidObjectException
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||