Class LocalizationServiceImpl

java.lang.Object
net.datenwerke.rs.utils.localization.LocalizationServiceImpl
All Implemented Interfaces:
Serializable

public class LocalizationServiceImpl extends Object implements Serializable
Offers localization similar to the default GWT i18n implementation, but on the serverside.
See Also:
  • Constructor Details

    • LocalizationServiceImpl

      public LocalizationServiceImpl()
  • Method Details

    • getMessages

      public static <T extends Messages> T getMessages(Class<T> msgInterface)
      Retrieves (and creates) an implementation of the supplied Message interface, where all methods are implemented to return the values specified in the current locales property file
    • getMessagesProvider

      public static <T extends Messages> <any> getMessagesProvider(Class<T> msgInterface)
    • getMessage

      public static <T extends Messages> String getMessage(Class<T> msgInterface, String msg)
    • createMessages

      public static <T extends Messages> T createMessages(Class<T> msgInterface, Map<String,? extends Map> xmappings) throws InstantiationException, IllegalAccessException
      Dynamically create an implementation of the supplied interface which retrieves the return values of all methods retuning type of String from a map
      Type Parameters:
      T -
      Parameters:
      msgInterface -
      Throws:
      IllegalAccessException
      InstantiationException
    • getAvailableLocales

      public static Collection<String> getAvailableLocales()
    • getLocale

      public static Locale getLocale()
    • getUserLocal

      public static Locale getUserLocal()
      Internal use only. Always use getLocale() Returns the raw(!) locale send back by the client
    • setUserLocal

      public static void setUserLocal(Locale locale)
    • setUserTimezone

      public static void setUserTimezone(String timezone)
    • getUserTimezone

      public String getUserTimezone()