Package de.chkal.mvctoolbox.core.message
Class MvcMessagesImpl
java.lang.Object
de.chkal.mvctoolbox.core.message.MvcMessagesImpl
- All Implemented Interfaces:
MvcMessages,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(MvcMessage message) Adds the given message.add(MvcMessage.Severity severity, String text) Adds a new global message with the given severity.add(jakarta.mvc.binding.BindingResult bindingResult) This method adds one error message for each binding error or constraint violation in the given binding result.Adds a new global info message.getAll()Returns a list of all messagesReturns a list of all messages with a severity of ERROR.getInfos()Returns a list of all messages with a severity of INFO.getMessage(String param) If there is at least one message queued for the given parameter, the first one is returned.getMessages(String param) Returns a list of all messages queued for the given parameter.Returns a list of all messages with a severity of WARNING.
-
Constructor Details
-
MvcMessagesImpl
public MvcMessagesImpl()
-
-
Method Details
-
add
Description copied from interface:MvcMessagesAdds a new global info message.- Specified by:
addin interfaceMvcMessages- Parameters:
text- The text of the message, must not benull- Returns:
- self
-
add
Description copied from interface:MvcMessagesAdds a new global message with the given severity.- Specified by:
addin interfaceMvcMessages- Parameters:
severity- The severity of the message, must not benulltext- The text of the message, must not benull- Returns:
- self
-
add
Description copied from interface:MvcMessagesThis method adds one error message for each binding error or constraint violation in the given binding result.- Specified by:
addin interfaceMvcMessages- Parameters:
bindingResult- The binding result to create messages from, ust not benull- Returns:
- self
-
add
Description copied from interface:MvcMessagesAdds the given message.- Specified by:
addin interfaceMvcMessages- Parameters:
message- the message- Returns:
- self
-
getAll
Description copied from interface:MvcMessagesReturns a list of all messages- Specified by:
getAllin interfaceMvcMessages- Returns:
- all messages
-
getInfos
Description copied from interface:MvcMessagesReturns a list of all messages with a severity of INFO.- Specified by:
getInfosin interfaceMvcMessages- Returns:
- all info messages
-
getWarnings
Description copied from interface:MvcMessagesReturns a list of all messages with a severity of WARNING.- Specified by:
getWarningsin interfaceMvcMessages- Returns:
- all warning messages
-
getErrors
Description copied from interface:MvcMessagesReturns a list of all messages with a severity of ERROR.- Specified by:
getErrorsin interfaceMvcMessages- Returns:
- all error messages
-
getMessage
Description copied from interface:MvcMessagesIf there is at least one message queued for the given parameter, the first one is returned. Will returnnullif no message for the parameter exists.- Specified by:
getMessagein interfaceMvcMessages- Parameters:
param- The parameter name- Returns:
- The first message for the parameter or
null - See Also:
-
getMessages
Description copied from interface:MvcMessagesReturns a list of all messages queued for the given parameter.- Specified by:
getMessagesin interfaceMvcMessages- Parameters:
param- The parameter name- Returns:
- All message for the given parameter
- See Also:
-