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| 限定符和类型 | 字段和说明 |
|---|---|
protected com.ibm.icu.util.UResourceBundle |
resources
The actual resource bundle.
|
| 构造器和说明 |
|---|
ResourceHandle(java.util.Locale locale)
已过时。
since 2.1
|
ResourceHandle(com.ibm.icu.util.ULocale locale)
Constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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()
已过时。
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()
ResourceBundlepublic java.util.ResourceBundle getResourceBundle()
Copyright © 2008 Actuate Corp. All rights reserved.