Exemple #1
0
 /**
  * Replies the text that corresponds to the specified resource.
  * <p>
  * The <code>resourcePath</code> argument should be a fully 
  * qualified class name. However, for compatibility with earlier 
  * versions, Sun's Java SE Runtime Environments do not verify this,
  * and so it is possible to access <code>PropertyResourceBundle</code>s
  * by specifying a path name (using "/") instead of a fully 
  * qualified class name (using ".").
  * 
  * @param resourcePath is the name (path) of the resource file, a fully qualified class name
  * @param key is the name of the resource into the specified file
  * @param defaultValue is the default value to replies if the resource does not contain the specified key. 
  * @param params is the the list of parameters which will
  * replaces the <code>#1</code>, <code>#2</code>... into the string.
  * @return the text that corresponds to the specified resource
  */
 public static String getStringWithDefaultFrom(String resourcePath, String key, String defaultValue, Object... params) {
     // This method try to use the plugin manager class loader
     // if it exists, otherwhise, it use the default class loader        
 	return getStringWithDefaultFrom(
 			ClassLoaderFinder.findClassLoader(),
 			resourcePath, key, defaultValue, params);
 }
Exemple #2
0
 /**
  * Replies the text that corresponds to the specified resource.
  * 
  * @param key is the name of the resource into the specified file
  * @param defaultValue is the default value to replies if the resource does not contain the specified key. 
  * @param params is the the list of parameters which will
  * replaces the <code>#1</code>, <code>#2</code>... into the string.
  * @return the text that corresponds to the specified resource
  */
 public static String getStringWithDefault(String key, String defaultValue, Object... params) {
 	Class<?> resource = detectResourceClass(null);
 	return getStringWithDefault(ClassLoaderFinder.findClassLoader(),resource,key,defaultValue,params);
 }
Exemple #3
0
 /**
  * Replies the text that corresponds to the specified resource.
  * <p>
  * This function assumes the classname of the caller as the
  * resource provider. 
  * 
  * @param key is the name of the resource into the specified file
  * @param params is the the list of parameters which will
  * replaces the <code>#1</code>, <code>#2</code>... into the string.
  * @return the text that corresponds to the specified resource
  */
 public static String getString(String key, Object... params) {
 	Class<?> resource = detectResourceClass(null);
 	return getString(ClassLoaderFinder.findClassLoader(),resource,key,params);
 }