org.jboss.ws.api.util
Class BundleUtils

java.lang.Object
  extended by org.jboss.ws.api.util.BundleUtils

public final class BundleUtils
extends Object

Utility class to get resource bundle and i18n message

Author:
Jim Ma

Method Summary
static ResourceBundle getBundle(Class<?> cls)
          Get resource bundle with a class
static String getMessage(ResourceBundle bundle, String key, Object... params)
          Get the i18n string message with an associated resource bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBundle

public static ResourceBundle getBundle(Class<?> cls)
Get resource bundle with a class

Parameters:
cls - the class to find the resource bundle
Returns:
ResourceBundle if exists, otherwise null

getMessage

public static String getMessage(ResourceBundle bundle,
                                String key,
                                Object... params)
Get the i18n string message with an associated resource bundle

Parameters:
bundle - resourceBundle
key - the key for the desired string
params - the message substitution parameters
Returns:
the formated string for the given key


Copyright © 2012 JBoss, by Red Hat. All Rights Reserved.