Package io.micronaut.runtime.context
Class CompositeMessageSource
java.lang.Object
io.micronaut.context.AbstractMessageSource
io.micronaut.runtime.context.CompositeMessageSource
- All Implemented Interfaces:
MessageSource
,Ordered
Composite message source that is the primary message source.
- Since:
- 1.2
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.context.AbstractMessageSource
AbstractMessageSource.MessageKey
Nested classes/interfaces inherited from interface io.micronaut.context.MessageSource
MessageSource.MessageContext
-
Field Summary
Fields inherited from interface io.micronaut.context.MessageSource
EMPTY
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionCompositeMessageSource
(@Nullable Collection<MessageSource> messageSources) The other messages sources. -
Method Summary
Modifier and TypeMethodDescriptiongetRawMessage
(@NonNull String code, @NonNull MessageSource.MessageContext context) Resolve a message for the given code and context.Methods inherited from class io.micronaut.context.AbstractMessageSource
interpolate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.context.MessageSource
getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getRawMessage, getRequiredMessage, getRequiredRawMessage
-
Constructor Details
-
CompositeMessageSource
The other messages sources.- Parameters:
messageSources
- The message sources.
-
-
Method Details
-
getRawMessage
@NonNull public @NonNull Optional<String> getRawMessage(@NonNull @NonNull String code, @NonNull @NonNull MessageSource.MessageContext context) Description copied from interface:MessageSource
Resolve a message for the given code and context.- Parameters:
code
- The codecontext
- The context- Returns:
- A message if present
-