|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.core.i18n.ResourceHandle
public class ResourceHandle
Represents a set of resources for a given package and locale. This class will associate with a user session. Each user session has a single locale. This class assumes that the resources are in the same location as the class itself, and are named "Messages.properties", "Messages_xx.properties", etc.
Once stable, the application will not access a message that does not exist. To help get the system stable, this class raises an assertion if the message key refers to a missing exception. The class then returns the message key itself as the message.
This class primarily works with messages. It can be extended to work with other resources as the need arises.
ThreadResources
Field Summary | |
---|---|
protected com.ibm.icu.util.UResourceBundle |
resources
The actual resource bundle. |
Constructor Summary | |
---|---|
ResourceHandle(java.util.Locale locale)
Deprecated. since 2.1 |
|
ResourceHandle(com.ibm.icu.util.ULocale locale)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
getMessage(java.lang.String key)
Get a message given the message key. |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object[] arguments)
Get a message that has placeholders. |
java.util.ResourceBundle |
getResourceBundle()
Deprecated. since 2.1 |
com.ibm.icu.util.UResourceBundle |
getUResourceBundle()
Returns the resource bundle for the current locale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.ibm.icu.util.UResourceBundle resources
Constructor Detail |
---|
public ResourceHandle(com.ibm.icu.util.ULocale locale)
locale
- the user's locale. If null, the default locale for the JVM
will be used.public ResourceHandle(java.util.Locale locale)
Method Detail |
---|
public java.lang.String getMessage(java.lang.String key)
key
- the message key
ResourceBundle.getString( String )
public java.lang.String getMessage(java.lang.String key, java.lang.Object[] arguments)
key
- the message keyarguments
- the set of arguments to be plugged into the message
ResourceBundle.getString( String )
,
MessageFormat.format( String, Object[] )
public com.ibm.icu.util.UResourceBundle getUResourceBundle()
ResourceBundle
public java.util.ResourceBundle getResourceBundle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |