Class LocalizationServiceImpl
java.lang.Object
net.datenwerke.rs.utils.localization.LocalizationServiceImpl
- All Implemented Interfaces:
Serializable
Offers localization similar to the default GWT i18n implementation, but on
the serverside.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Messages>
TcreateMessages(Class<T> msgInterface, Map<String, ? extends Map> xmappings) Dynamically create an implementation of the supplied interface which retrieves the return values of all methods retuning type of String from a mapstatic Collection<String> static LocalegetMessage(Class<T> msgInterface, String msg) static <T extends Messages>
TgetMessages(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 filestatic <T extends Messages>
<any>getMessagesProvider(Class<T> msgInterface) static LocaleInternal use only.static voidsetUserLocal(Locale locale) static voidsetUserTimezone(String timezone)
-
Constructor Details
-
LocalizationServiceImpl
public LocalizationServiceImpl()
-
-
Method Details
-
getMessages
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
-
getMessage
-
createMessages
public static <T extends Messages> T createMessages(Class<T> msgInterface, Map<String, ? extends Map> xmappings) throws InstantiationException, IllegalAccessExceptionDynamically 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:
IllegalAccessExceptionInstantiationException
-
getAvailableLocales
-
getLocale
-
getUserLocal
Internal use only. Always use getLocale() Returns the raw(!) locale send back by the client -
setUserLocal
-
setUserTimezone
-
getUserTimezone
-