Class ThreadLocalLocaleResolver
java.lang.Object
io.github.belgif.rest.problem.ee.server.jaxrs.i18n.ThreadLocalLocaleResolver
- All Implemented Interfaces:
io.github.belgif.rest.problem.i18n.LocaleResolver
public class ThreadLocalLocaleResolver
extends Object
implements io.github.belgif.rest.problem.i18n.LocaleResolver
LocaleResolver implementation that uses a ThreadLocal.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ThreadLocalLocaleResolver
public ThreadLocalLocaleResolver()
-
-
Method Details
-
getLocale
- Specified by:
getLocalein interfaceio.github.belgif.rest.problem.i18n.LocaleResolver
-
setLocale
Set the locale of the current request.NOTE: The locale is stored in a ThreadLocal that must be cleaned up with
clear().- Parameters:
locale- the locale of the current request.
-
clear
public static void clear()Clear the locale of the current request.
-