uPortal 2.4.1
API Documentation

org.jasig.portal.lang
Class Resources

java.lang.Object
  extended byorg.jasig.portal.lang.Resources

public final class Resources
extends java.lang.Object

The Resources class defines a set of utility methods which translate an internationalized string to a localized string. The transformation is done with the use of standard java.util.ResourceBundle and java.text.MessageFormat classes.

Version:
"$Revision: 1.2 $"
Author:
Jan Nielsen

Method Summary
static java.lang.String getString(java.lang.Class client, java.lang.String name)
          Returns the localized value of the specified string resource.
static java.lang.String getString(java.lang.Class client, java.lang.String name, java.lang.String[] objects)
          Returns the localized value of the specified string resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getString

public static final java.lang.String getString(java.lang.Class client,
                                               java.lang.String name)
Returns the localized value of the specified string resource. The string resource is resolved by using the client parameter to lookup the associated ResourceBundle object and returning the string value associated with the specified name.

Parameters:
client - class to use to find the resource bundle
name - name of the string resource
Returns:
value of the string resource
Throws:
java.lang.NullPointerException - if client or name is null
java.util.MissingResourceException - if the resource name is not found

getString

public static final java.lang.String getString(java.lang.Class client,
                                               java.lang.String name,
                                               java.lang.String[] objects)
Returns the localized value of the specified string resource. The string resource is resolved by using the client parameter to lookup the associated ResourceBundle object and returning the string value associated with the specified name. The MessageFormat class is used to format the localized string using the specified runtime parameters.

Parameters:
client - class to use to find the resource bundle
name - name of the string resource
objects - runtime objects to be inserted into resource
Returns:
value of the string resource
Throws:
java.lang.NullPointerException - if client or name is null
java.util.MissingResourceException - if the resource name is not found

uPortal 2.4.1
API Documentation