public static interface MessageSource.MessageContext
Modifier and Type | Field and Description |
---|---|
static MessageSource.MessageContext |
DEFAULT
The default message context.
|
Modifier and Type | Method and Description |
---|---|
default java.util.Locale |
getLocale()
The locale to use to resolve messages.
|
default java.util.Locale |
getLocale(java.util.Locale defaultLocale)
The locale to use to resolve messages.
|
default java.util.Map<java.lang.String,java.lang.Object> |
getVariables() |
static MessageSource.MessageContext |
of(java.util.Locale locale)
Obtain a message context for the given locale.
|
static MessageSource.MessageContext |
of(java.util.Locale locale,
java.util.Map<java.lang.String,java.lang.Object> variables)
Obtain a message context for the given locale and variables.
|
static MessageSource.MessageContext |
of(java.util.Map<java.lang.String,java.lang.Object> variables)
Obtain a message context for the given variables.
|
static final MessageSource.MessageContext DEFAULT
@NonNull default java.util.Locale getLocale()
@NonNull default java.util.Locale getLocale(@Nullable java.util.Locale defaultLocale)
defaultLocale
- The locale to use if no locale is present@NonNull default java.util.Map<java.lang.String,java.lang.Object> getVariables()
@NonNull static MessageSource.MessageContext of(@Nullable java.util.Locale locale)
locale
- The locale@NonNull static MessageSource.MessageContext of(@Nullable java.util.Map<java.lang.String,java.lang.Object> variables)
variables
- The variables.@NonNull static MessageSource.MessageContext of(@Nullable java.util.Locale locale, @Nullable java.util.Map<java.lang.String,java.lang.Object> variables)
locale
- The localevariables
- The variables.