com.davesag.jsf
Class MessageHelper

java.lang.Object
  extended bycom.davesag.jsf.MessageHelper

public class MessageHelper
extends Object

A helper class for loading application messages.

Version:
CVS Revision $Id: MessageHelper.java,v 1.13 2004/09/01 11:26:35 davesag Exp $

Constructor Summary
MessageHelper()
           
 
Method Summary
static ClassLoader getClassLoader()
          get the ClassLoader for the current thread of failing that, the default classloader.
static Locale getLocale(javax.faces.context.FacesContext aContext)
          get the Locale for the given context.
static javax.faces.application.FacesMessage getMessage(String aBundleName, String aResourceId, Object[] params)
          get a localised message from the given bundle, using the given key and params.
static String getString(String aBundle, String aResourceId, Object[] params)
          get a localised string from the given bundle, using the given key and params.
static String getString(String aBundle1, String aBundle2, String aResourceId, Locale aLocale, ClassLoader aLoader, Object[] params)
          get a localised string from the given bundles, using the given key and params.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageHelper

public MessageHelper()
Method Detail

getMessage

public static javax.faces.application.FacesMessage getMessage(String aBundleName,
                                                              String aResourceId,
                                                              Object[] params)
get a localised message from the given bundle, using the given key and params.

Parameters:
aBundleName - the fully qualified bundle name.
aResourceId - the key
params - an array of params
Returns:
a localised faces message

getString

public static String getString(String aBundle,
                               String aResourceId,
                               Object[] params)
get a localised string from the given bundle, using the given key and params.

Parameters:
aBundle - the fully qualified bundle name.
aResourceId - the key
params - an array of params
Returns:
a localised string

getString

public static String getString(String aBundle1,
                               String aBundle2,
                               String aResourceId,
                               Locale aLocale,
                               ClassLoader aLoader,
                               Object[] params)
get a localised string from the given bundles, using the given key and params.

Parameters:
aBundle1 - the first fully qualified bundle name.
aBundle2 - the second fully qualified bundle name.
aResourceId - the key
aLocale - the locale
aLoader - the classloader
params - an array of params
Returns:
a localised string

getLocale

public static Locale getLocale(javax.faces.context.FacesContext aContext)
get the Locale for the given context.

Parameters:
aContext - a faces context
Returns:
the Locale for the given context.

getClassLoader

public static ClassLoader getClassLoader()
get the ClassLoader for the current thread of failing that, the default classloader.

Returns:
a classloader


JSF Helper API version 20 Jan 2005. (C) 2004 Dave Sag.