Class Resource

java.lang.Object
com.groiss.component.Resource
All Implemented Interfaces:
Serializable

public class Resource extends Object implements Serializable
Provides resource strings in several languages.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getString

      public String getString(String key)
    • getString

      public String getString(String key, Object... arguments)
    • getString

      public String getString(String key, Locale l)
    • getErrorMessage

      public String getErrorMessage(String key)
    • getErrorMessage

      public String getErrorMessage(String key, Object... arguments)
    • getErrorMessage

      public String getErrorMessage(String key, Locale l)
    • loadAndLocalizeResource

      public String loadAndLocalizeResource(String resource)
    • loadAndLocalizeResource

      public String loadAndLocalizeResource(String resource, Locale l)
    • loadAndLocalizeResource

      public String loadAndLocalizeResource(String resource, boolean couldBeMobile)
    • loadAndLocalizeResource

      public String loadAndLocalizeResource(String resource, Locale l, boolean couldBeMobile)
      Parameters:
      resource -
      l -
      couldBeMobile - when set to true try to load mobile resource first
      Returns:
    • localize

      public String localize(String resource, Locale l)
      Localize a string containing keys in following syntax: @@@key@@. If you want to have @@@ not replaceed write @@@@.
      Parameters:
      resource - the string to localize
      l - the used locale
      Returns:
      the localized string
    • getDefaultLocale

      public Locale getDefaultLocale()
    • setDefaultLocale

      public void setDefaultLocale(Locale newDefault)
    • getErrorsName

      public String getErrorsName()
    • getStringsName

      public String getStringsName()
    • getResourceBundle

      protected ResourceBundle getResourceBundle(Locale l, String bundleName)
    • createLocalizedList

      public List<String> createLocalizedList(String... args)
    • toString

      public String toString()
      Overrides:
      toString in class Object