Class ResUtil

java.lang.Object
org.jjazz.utilities.api.ResUtil

public class ResUtil extends Object
Helper methods to use ResourceBundles.

  • Constructor Details

    • ResUtil

      public ResUtil()
  • Method Details

    • getString

      public static String getString(Class<?> cl, String key, Object... params)
      Retrieve the resource string from key.

      Assume that the resource bundle is in aClass.getPackageName()+"/Bundle*".

      Parameters:
      cl -
      key -
      params - Optional parameters to be used if the resource string is a compound message
      Returns:
    • getBundle

      public static ResourceBundle getBundle(Class<?> cl)
      Look for a Bundle.properties in the same package than the specified class.
      Parameters:
      cl -
      Returns:
    • getCommonString

      public static String getCommonString(String key, Object... params)
      Get a translated string for common messages which are used at several places in the application.

      See file resources/org/jjazz/utilities/api/Bundle.properties for the available common strings.

      Parameters:
      key -
      params - Optional parameters to be used if the resource string is a compound message
      Returns:
      Can't be null