org.jppf.utils
Class LocalizationUtils

java.lang.Object
  extended by org.jppf.utils.LocalizationUtils

public final class LocalizationUtils
extends Object

Utility methods to localize messages in the JPPF components.

Author:
Laurent Cohen

Constructor Summary
LocalizationUtils()
           
 
Method Summary
static String getLocalisationBase(String base, String filename)
          Compute a localisation base path from a base folder and a file name.
static String getLocalized(String baseName, String key)
          Get a localized property value.
static String getLocalized(String baseName, String key, String def)
          Get a localized property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizationUtils

public LocalizationUtils()
Method Detail

getLocalized

public static String getLocalized(String baseName,
                                  String key)
Get a localized property value.

Parameters:
baseName - the base name to use, in combination with the default locale, to lookup the appropriate resource bundle.
key - the key for the localized value to lookup.
Returns:
the name localized through the default locale information, or the key itself if it could not be localized.
See Also:
ResourceBundle

getLocalized

public static String getLocalized(String baseName,
                                  String key,
                                  String def)
Get a localized property value.

Parameters:
baseName - the base name to use, in combination with the default locale, to lookup the appropriate resource bundle.
key - the key for the localized value to lookup.
def - the default value to return if no localized string could be found.
Returns:
the name localized through the default locale information, or the key itself if it could not be localized.
See Also:
ResourceBundle

getLocalisationBase

public static String getLocalisationBase(String base,
                                         String filename)
Compute a localisation base path from a base folder and a file name.

Parameters:
base - the base folder path as a string.
filename - the filename from which to get the resource bundle name.
Returns:
the complete path to a resource bundle.


Copyright © 2005-2010 JPPF Team.