MessageSource that delegates all calls to the parent MessageSource.
If no parent is available, it simply won't resolve any message.
Used as placeholder by AbstractApplicationContext, if the context doesn't define its own MessageSource. Not intended for direct use in applications.
AbstractApplicationContext
| Modifier and Type | Field and Description |
|---|---|
| private MessageSource |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getMessage(String
the message code to look up, e.g. 'calculator.noRateSet'.
MessageSource users are encouraged to base message names on qualified class
or package names, avoiding potential conflicts and ensuring maximum clarity. code, Object[] an array of arguments that will be filled in for params within
the message (params look like "{0}", "{1,date}", "{2,time}" within a message),
or args, String null if nonea default message to return if the lookup fails defaultMessage, Locale the locale in which to do the lookup locale)Implements org. Try to resolve the message. |
| public String | getMessage(String
the message code to look up, e.g. 'calculator.noRateSet'.
MessageSource users are encouraged to base message names on qualified class
or package names, avoiding potential conflicts and ensuring maximum clarity. code, Object[] an array of arguments that will be filled in for params within
the message (params look like "{0}", "{1,date}", "{2,time}" within a message),
or args, Locale null if nonethe locale in which to do the lookup locale)Implements org. Try to resolve the message. |
| public String | getMessage(MessageSourceResolvable
the value object storing attributes required to resolve a message
(may include a default message) resolvable, Locale the locale in which to do the lookup locale)Implements org. Try to resolve the message using all the attributes contained within the
Note We must throw a |
| public MessageSource | getParentMessageSource()
Implements org. Return the parent of this MessageSource, or |
| public void | setParentMessageSource(MessageSource
the parent MessageSource that will be used to
resolve messages that this object can't resolve.
May be parent)null, in which case no further resolution is possible.Implements org. Set the parent that will be used to try to resolve messages that this object can't resolve. |
| public String |
| parentMessageSource | back to summary |
|---|---|
| private MessageSource parentMessageSource
| |
| DelegatingMessageSource | back to summary |
|---|---|
| public DelegatingMessageSource() | |
| getMessage | back to summary |
|---|---|
| public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) Implements org. Doc from org. Try to resolve the message. Return default message if no message was found.
| |
| getMessage | back to summary |
|---|---|
| public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException Implements org. Doc from org. Try to resolve the message. Treat as an error if the message can't be found.
| |
| getMessage | back to summary |
|---|---|
| public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException Implements org. Doc from org. Try to resolve the message using all the attributes contained within the
Note We must throw a
| |
| getParentMessageSource | back to summary |
|---|---|
| public MessageSource getParentMessageSource() Implements org. Doc from org. Return the parent of this MessageSource, or | |
| setParentMessageSource | back to summary |
|---|---|
| public void setParentMessageSource(MessageSource parent) Implements org. Doc from org. Set the parent that will be used to try to resolve messages that this object can't resolve.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |