info.informatica.util.locale
Class ObjectBundle

java.lang.Object
  extended by info.informatica.util.locale.ObjectBundle

public class ObjectBundle
extends Object

Map of localized objects.

The objects have been initialized with the contents of the files following the schema:

   baseName.ext, baseName.locale.ext
 

Version:
2.00
Author:
amengual at informatica dot info

Constructor Summary
ObjectBundle(String path, ResourceFactory rf)
          All subclasses constructors MUST call loadDefaultFile().
ObjectBundle(String baseName, String ext, ResourceFactory rf)
           
 
Method Summary
 Object get()
           
 Object get(Locale locale)
           
 String getBaseName()
           
 Object getBest(Locale locale)
           
 Locale getBestLocale(Enumeration<Locale> locales)
           
 Locale getBestLocale(Locale[] loc)
          Gets the best locale for loc
 Locale getDefaultLocale()
           
 String getExtension()
           
 long getLastModified()
           
 void setDefaultLocale(Locale locale)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectBundle

public ObjectBundle(String path,
                    ResourceFactory rf)
             throws IOException
All subclasses constructors MUST call loadDefaultFile().

Parameters:
path - Path to default file, optionally including an extension. Separates the extension assuming a '.' as separator.
Throws:
IOException

ObjectBundle

public ObjectBundle(String baseName,
                    String ext,
                    ResourceFactory rf)
             throws IOException
Parameters:
baseName - Path to default file, without the extension.
ext - the extension (can be null if none)
Throws:
IOException
Method Detail

getExtension

public String getExtension()

getLastModified

public long getLastModified()

get

public Object get()
Returns:
short label for name, for the default locale

getBest

public Object getBest(Locale locale)

get

public Object get(Locale locale)

getBestLocale

public Locale getBestLocale(Locale[] loc)
Gets the best locale for loc


getBestLocale

public Locale getBestLocale(Enumeration<Locale> locales)

getDefaultLocale

public Locale getDefaultLocale()

setDefaultLocale

public void setDefaultLocale(Locale locale)

getBaseName

public String getBaseName()

toString

public String toString()
Overrides:
toString in class Object