Class CombinableMessageSource
-
- All Implemented Interfaces:
-
org.springframework.context.HierarchicalMessageSource,org.springframework.context.MessageSource
public class CombinableMessageSource extends AbstractMessageSourceHandles itself first, then handles [brother] it, then the parent
- Since:
2019-09-15
trydofor
-
-
Field Summary
Fields Modifier and Type Field Description public MessageSourceparentMessageSourceprotected PropertiescommonMessages
-
Constructor Summary
Constructors Constructor Description CombinableMessageSource()
-
Method Summary
Modifier and Type Method Description voidremoveMessage(String code)voidremoveMessage(String code, Locale locale)voidaddMessage(String code, Locale locale, String msg)voidaddMessage(Map<out Object, out Object> messages, Locale locale)voidsetParentMessageSource(@Nullable() MessageSource parent)voidaddMessage(HierarchicalMessageSource messageSource, int order)Combine other messageSource in order, and the one with the smaller order number will be resolved first. voidremoveMessage(HierarchicalMessageSource messageSource)remove messageSource -
Methods inherited from class org.springframework.context.support.AbstractMessageSource
getMessage, getParentMessageSource, setCommonMessages, setParentMessageSource, setUseCodeAsDefaultMessage -
Methods inherited from class org.springframework.context.support.MessageSourceSupport
setAlwaysUseMessageFormat -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
removeMessage
void removeMessage(String code)
-
removeMessage
void removeMessage(String code, Locale locale)
-
addMessage
void addMessage(String code, Locale locale, String msg)
-
addMessage
void addMessage(Map<out Object, out Object> messages, Locale locale)
-
setParentMessageSource
void setParentMessageSource(@Nullable() MessageSource parent)
-
addMessage
void addMessage(HierarchicalMessageSource messageSource, int order)
Combine other messageSource in order, and the one with the smaller order number will be resolved first. If order equals Integer.MIN_VALUE, it means that the message will be removed.
- Parameters:
messageSource- other messageSourceorder- order Integer#MIN_VALUE means remove
-
removeMessage
void removeMessage(HierarchicalMessageSource messageSource)
remove messageSource
- Parameters:
messageSource- to be removed
-
-
-
-