Package dev.orne.i18n.spring
Class I18nSpringContextProvider
java.lang.Object
dev.orne.i18n.context.AbstractI18nContextProvider
dev.orne.i18n.context.ThreadI18nContextProvider
dev.orne.i18n.spring.I18nSpringContextProvider
- All Implemented Interfaces:
I18nContextProvider
@API(status=STABLE,
since="0.1")
public class I18nSpringContextProvider
extends ThreadI18nContextProvider
Implementation of
I18nContextProvider
for Spring contexts.
Uses {code I18nSpringContext} as context implementation and supports
MessageSource
auto-wiring for default I18N resources lookup.
- Since:
- 0.1
- Version:
- 1.0, 2021-01
- Author:
- (w) Iker Hernaez
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface forI18nSpringContextProvider
instance builders.protected static class
I18nSpringContextProvider.BuilderImpl<T extends I18nSpringContextProvider,
B extends I18nSpringContextProvider.BuilderImpl<T, B>> Builder ofI18nSpringContextProvider
instances.Nested classes/interfaces inherited from class dev.orne.i18n.context.ThreadI18nContextProvider
ThreadI18nContextProvider.Factory
Nested classes/interfaces inherited from interface dev.orne.i18n.context.I18nContextProvider
I18nContextProvider.Configurer, I18nContextProvider.Registry
-
Field Summary
Fields inherited from class dev.orne.i18n.context.ThreadI18nContextProvider
TYPE
-
Constructor Summary
ModifierConstructorDescriptionprotected
I18nSpringContextProvider
(@NotNull I18nSpringContextProvider.BuilderImpl<?, ?> builder) Creates a new instance based on specified builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull I18nSpringContextProvider.Builder
builder()
Creates a newI18nSpringContextProvider
instances builder.void
Clears the I18N context for the current thread.@NotNull I18nContext
Creates a new I18N context with default values.@NotNull I18nContext
createContext
(@NotNull I18nContext parent) Creates a new I18N context with values inherited from the specified parent I18N context.Methods inherited from class dev.orne.i18n.context.ThreadI18nContextProvider
equals, getContext, getContexts, hashCode, isContextValid, isInheritable
Methods inherited from class dev.orne.i18n.context.AbstractI18nContextProvider
getAvailableLocales, getDefaultI18nResources, getDefaultLocaleSupplier, getI18nResources, getI18nResources, getSessionUUID, invalidate
-
Constructor Details
-
I18nSpringContextProvider
protected I18nSpringContextProvider(@NotNull @NotNull I18nSpringContextProvider.BuilderImpl<?, ?> builder) Creates a new instance based on specified builder.- Parameters:
builder
- The I18N context provider builder.
-
-
Method Details
-
builder
Creates a newI18nSpringContextProvider
instances builder.- Returns:
- The
I18nSpringContextProvider
instances builder.
-
createContext
Creates a new I18N context with default values.- Overrides:
createContext
in classAbstractI18nContextProvider
- Returns:
- The new I18N context
-
createContext
Creates a new I18N context with values inherited from the specified parent I18N context.- Overrides:
createContext
in classAbstractI18nContextProvider
- Parameters:
parent
- The parent I18N context- Returns:
- The new I18N context
-
clearContext
public void clearContext()Description copied from class:ThreadI18nContextProvider
Clears the I18N context for the current thread.- Specified by:
clearContext
in interfaceI18nContextProvider
- Overrides:
clearContext
in classThreadI18nContextProvider
-