public class ResourceHandle
extends java.lang.Object
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
Modifier and Type | Field and Description |
---|---|
protected com.ibm.icu.util.UResourceBundle |
resources
The actual resource bundle.
|
Constructor and Description |
---|
ResourceHandle(java.util.Locale locale)
Deprecated.
since 2.1
|
ResourceHandle(com.ibm.icu.util.ULocale locale)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected com.ibm.icu.util.UResourceBundle resources
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)
public java.lang.String getMessage(java.lang.String key)
key
- the message keyResourceBundle.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 messageResourceBundle.getString( String )
,
MessageFormat.format( String, Object[] )
public com.ibm.icu.util.UResourceBundle getUResourceBundle()
ResourceBundle
public java.util.ResourceBundle getResourceBundle()
Copyright © 2008 Actuate Corp. All rights reserved.