| org.sakaiproject.util.ResourceLoader
ResourceLoader | public class ResourceLoader extends DummyMap implements InternationalizedMessages(Code) | | ResourceLoader provides an alternate implementation of org.util.ResourceBundle, dynamically selecting the prefered locale from either the user's session or from the user's sakai preferences
author: Sugiura, Tatsuki (University of Nagoya) |
M_log | protected static Log M_log(Code) | | |
ResourceLoader | public ResourceLoader()(Code) | | Default constructor (does nothing)
|
ResourceLoader | public ResourceLoader(String name)(Code) | | Constructor: set baseName
Parameters: name - default ResourceBundle base filename |
get | public Object get(Object key)(Code) | | Return (generic object) value for specified property in current locale specific ResourceBundle * *
Parameters: key - property key to look up in current ResourceBundle * * value for specified property key |
getBundle | protected ResourceBundle getBundle()(Code) | | Return ResourceBundle for user's preferred locale
user's ResourceBundle object |
getBundleAsMap | protected Map getBundleAsMap()(Code) | | |
getFormattedMessage | public String getFormattedMessage(String key, Object[] args)(Code) | | Return formatted message based on locale-specific pattern
Parameters: key - maps to locale-specific pattern in properties file Parameters: args - parameters to format and insert according to above pattern formatted message |
getInt | public int getInt(String key, int dflt)(Code) | | Access some named configuration value as an int.
Parameters: key - property key to look up in current ResourceBundle Parameters: dflt - The value to return if not found. The property value with this name, or the default value if not found. |
getLocale | public Locale getLocale()(Code) | | Return user's prefered locale * First: return locale from Sakai user preferences, if available * Second: return locale from user session, if available * Last: return system default locale * *
user's Locale object |
getString | public String getString(String key)(Code) | | Return string value for specified property in current locale specific ResourceBundle * *
Parameters: key - property key to look up in current ResourceBundle * * String value for specified property key |
getString | public String getString(String key, String dflt)(Code) | | Return string value for specified property in current locale specific ResourceBundle
Parameters: key - property key to look up in current ResourceBundle Parameters: dflt - the default value to be returned in case the property is missing String value for specified property key |
getStrings | public String[] getStrings(String key)(Code) | | Access some named property values as an array of strings. The name is the base name. name + ".count" must be defined to be a positive integer - how many are defined. name + "." + i (1..count) must be defined to be the values.
Parameters: key - property key to look up in current ResourceBundle The property value with this name, or the null if not found. |
loadBundle | protected ResourceBundle loadBundle(Locale loc)(Code) | | Return ResourceBundle for specified locale
Parameters: bundle - properties bundle * * locale specific ResourceBundle |
purgeCache | public void purgeCache()(Code) | | Clear bundles hashmap
|
setBaseName | public void setBaseName(String name)(Code) | | Set baseName
Parameters: name - default ResourceBundle base filename |
setBundle | protected void setBundle(Locale loc, ResourceBundle bundle)(Code) | | Add loc (key) and bundle (value) to this.bundles hash
Parameters: loc - Language/Region Locale * Parameters: bundle - properties bundle |
|
|