Package com.atlassian.jira.util
Interface MessageSet
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractMessageSet,ListOrderedMessageSetImpl,MessageSetImpl
Used to communicate error and warning messages.
- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumMessage levelsstatic classA simple class for holding link text and a link url. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorMessage(String errorMessage) Adds an error message.voidaddErrorMessage(String errorMessage, MessageSet.MessageLink link) Adds an error message and associates a link with the error.voidaddErrorMessageInEnglish(String errorMessage) Adds an error message in English.voidaddMessage(MessageSet.Level level, String errorMessage) Adds a message with the given warning / error levelvoidaddMessage(MessageSet.Level level, String errorMessage, MessageSet.MessageLink link) Adds an error message with the given warning / error level and associates a link with the error.voidaddMessageSet(MessageSet messageSet) Will concatenate this message set with the provided message set.voidaddWarningMessage(String warningMessage) Adds a warning message.voidaddWarningMessage(String warningMessage, MessageSet.MessageLink link) Adds a warning message and associates a link with the warning.voidaddWarningMessageInEnglish(String warningMessage) Adds a warning message in English.Returns a unique set of all the English error messages.getLinkForError(String errorMsg) getLinkForWarning(String warningMsg) Returns a unique set of all the English warning messages.booleanReturnstrueif there are error messages,falseotherwise.booleanReturnstrueif there are messages of any type,falseotherwise.booleanReturnstrueif there are warning messages,falseotherwise.
-
Method Details
-
getErrorMessages
- Returns:
- a unique set of error messages, these messages are separate from the warning messages, never null.
-
getLinkForError
- Parameters:
errorMsg- the unique error message- Returns:
- the MessageLink that is associated with the error, if one exists, null otherwise.
-
getErrorMessagesInEnglish
Returns a unique set of all the English error messages.- Returns:
- a unique set of all the English error messages.
- See Also:
-
getWarningMessages
- Returns:
- a unique set of warning messages, these messages are separate from the error messages, never null.
-
getLinkForWarning
- Parameters:
warningMsg- the unique warning message- Returns:
- the MessageLink that is associated with the warning, if one exists, null otherwise.
-
getWarningMessagesInEnglish
Returns a unique set of all the English warning messages.- Returns:
- a unique set of all the English warning messages.
- See Also:
-
hasAnyErrors
boolean hasAnyErrors()Returnstrueif there are error messages,falseotherwise.- Returns:
trueif there are error messages,falseotherwise.
-
hasAnyWarnings
boolean hasAnyWarnings()Returnstrueif there are warning messages,falseotherwise.- Returns:
trueif there are warning messages,falseotherwise.
-
hasAnyMessages
boolean hasAnyMessages()Returnstrueif there are messages of any type,falseotherwise. That is, it will return true if hasAnyErrors() istrueor hasAnyWarnings() istrue.- Returns:
trueif there are messages of any type,falseotherwise.
-
addMessageSet
Will concatenate this message set with the provided message set. All new errors and warnings will be added to the existing errors and warnings.- Parameters:
messageSet- contains the new errors and warnings to add to this set.
-
addMessage
Adds a message with the given warning / error level- Parameters:
level- message levelerrorMessage- the message to add.
-
addMessage
Adds an error message with the given warning / error level and associates a link with the error.- Parameters:
level- message levelerrorMessage- the message to add.link- the link to show the users associated with this error.
-
addErrorMessage
Adds an error message.- Parameters:
errorMessage- the message to add.
-
addErrorMessage
Adds an error message and associates a link with the error.- Parameters:
errorMessage- the message to add.link- the link to show the users associated with this error.
-
addErrorMessageInEnglish
Adds an error message in English.This is useful when the
addErrorMessage(String)method is used to add translated messages, and you want to be able to get a set of the messages in English as well. Eg, in the Project Import we show the translated messages on screen during validation, and log the English versions in case Atlassian Support needs to read the logs later.- Parameters:
errorMessage- the message to add.- See Also:
-
addWarningMessage
Adds a warning message.- Parameters:
warningMessage- the message to add.
-
addWarningMessage
Adds a warning message and associates a link with the warning.- Parameters:
warningMessage- the message to add.link- the link to show the users associated with this warning.
-
addWarningMessageInEnglish
Adds a warning message in English.This is useful when the
addWarningMessage(String)method is used to add translated messages, and you want to be able to get a set of the messages in English as well. Eg, in the Project Import we show the translated messages on screen during validation, and log the English versions in case Atlassian Support needs to read the logs later.- Parameters:
warningMessage- the message to add.- See Also:
-