net.sf.locale4j.storage
Interface LocaleStore

All Known Implementing Classes:
HashMapStore, HashTableStore, TreeMapStore

public interface LocaleStore

An interface for classes capable of storing locale data.


Method Summary
 void addLocale(Locale locale)
          Adds the specified locale to the store without any key/value pairs.
 String get(Locale locale, String key)
          Fetches a string in the language specified by the locale.
 List<String> getKeys(Locale locale)
          Fetch a list of keys for the given locale.
 List<Locale> getLocales()
          Fetch a list of locales for which translations exist.
 void put(Locale locale, String key, String text)
          Stores a string in the language specified by the locale.
 Object removeKey(Locale locale, String key)
          Removes a string from the language specified by the locale.
 Object removeLocale(Locale locale)
          Removes and entire locale.
 

Method Detail

getLocales

List<Locale> getLocales()
Fetch a list of locales for which translations exist.

Returns:
a list of locales.

getKeys

List<String> getKeys(Locale locale)
Fetch a list of keys for the given locale.

Parameters:
locale - the locale of the Strings the keys point to.
Returns:
a list of keys

get

String get(Locale locale,
           String key)
Fetches a string in the language specified by the locale.

Parameters:
locale - the locale for which the String is localized.
key - the key used to reference the stored String.
Returns:
the localized string.

put

void put(Locale locale,
         String key,
         String text)
Stores a string in the language specified by the locale. If the string does not exist, "???" is returned.

Parameters:
locale - the locale for which the String is localized.
key - the key used to reference the stored String.
text - the String to store.

addLocale

void addLocale(Locale locale)
Adds the specified locale to the store without any key/value pairs.

Parameters:
locale -

removeKey

Object removeKey(Locale locale,
                 String key)
                 throws Exception
Removes a string from the language specified by the locale.

Parameters:
locale - the locale for which the String is localized.
key - the key used to reference the stored String.
Returns:
the values associated with the removed key, or null if the key/table doesn't exist or is set to null.
Throws:
Exception

removeLocale

Object removeLocale(Locale locale)
                    throws Exception
Removes and entire locale.

Parameters:
locale - the locale to remove.
Returns:
the values associated with the removed key, or null if the key/table doesn't exist or is set to null.
Throws:
Exception


Copyright © 2007-2008 Vermont Department of Taxes. All Rights Reserved.