public class StaticMessageSource extends AbstractMessageSource
AbstractMessageSource.MessageKey
MessageSource.MessageContext
EMPTY
Constructor and Description |
---|
StaticMessageSource() |
Modifier and Type | Method and Description |
---|---|
StaticMessageSource |
addMessage(java.util.Locale locale,
java.lang.String code,
java.lang.String message)
Adds a message to the default locale.
|
StaticMessageSource |
addMessage(java.lang.String code,
java.lang.String message)
Adds a message to the default locale.
|
java.util.Optional<java.lang.String> |
getRawMessage(java.lang.String code,
MessageSource.MessageContext context)
Resolve a message for the given code and context.
|
interpolate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessage, getMessage, getRawMessage, getRequiredMessage, getRequiredRawMessage
@NonNull public StaticMessageSource addMessage(@NonNull java.lang.String code, @NonNull java.lang.String message)
code
- The codemessage
- The message@NonNull public StaticMessageSource addMessage(@NonNull java.util.Locale locale, @NonNull java.lang.String code, @NonNull java.lang.String message)
locale
- The localecode
- The codemessage
- The message@NonNull public java.util.Optional<java.lang.String> getRawMessage(@NonNull java.lang.String code, @NonNull MessageSource.MessageContext context)
MessageSource
code
- The codecontext
- The context