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 UResourceBundle |
resources
The actual resource bundle.
|
Constructor and Description |
---|
ResourceHandle(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
|
UResourceBundle |
getUResourceBundle()
Returns the resource bundle for the current locale.
|
protected UResourceBundle resources
public ResourceHandle(ULocale locale)
locale
- the user's locale. If null, the default locale for the JVM
will be used.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 UResourceBundle getUResourceBundle()
ResourceBundle
public java.util.ResourceBundle getResourceBundle()
Copyright © 2014 OpenText Corp. All rights reserved.