com.atlassian.jira.util
Interface MessageSet

All Known Implementing Classes:
AbstractMessageSet, ListOrderedMessageSetImpl, MessageSetImpl

public interface MessageSet

Used to communicate error and warning messages.

Since:
v3.13

Nested Class Summary
static class MessageSet.MessageLink
          A simple class for holding link text and a link url.
 
Method Summary
 void addErrorMessage(java.lang.String errorMessage)
          Adds an error message.
 void addErrorMessage(java.lang.String errorMessage, MessageSet.MessageLink link)
          Adds an error message and associates a link with the error.
 void addErrorMessageInEnglish(java.lang.String errorMessage)
          Adds an error message in English.
 void addMessageSet(MessageSet messageSet)
          Will concatenate this message set with the provided message set.
 void addWarningMessage(java.lang.String warningMessage)
          Adds a warning message.
 void addWarningMessage(java.lang.String warningMessage, MessageSet.MessageLink link)
          Adds a warning message and associates a link with the warning.
 void addWarningMessageInEnglish(java.lang.String warningMessage)
          Adds a warning message in English.
 java.util.Set<java.lang.String> getErrorMessages()
           
 java.util.Set<java.lang.String> getErrorMessagesInEnglish()
          Returns a unique set of all the English error messages.
 MessageSet.MessageLink getLinkForError(java.lang.String errorMsg)
           
 MessageSet.MessageLink getLinkForWarning(java.lang.String warningMsg)
           
 java.util.Set<java.lang.String> getWarningMessages()
           
 java.util.Set<java.lang.String> getWarningMessagesInEnglish()
          Returns a unique set of all the English warning messages.
 boolean hasAnyErrors()
          Returns true if there are error messages, false otherwise.
 boolean hasAnyMessages()
          Returns true if there are messages of any type, false otherwise.
 boolean hasAnyWarnings()
          Returns true if there are warning messages, false otherwise.
 

Method Detail

getErrorMessages

java.util.Set<java.lang.String> getErrorMessages()
Returns:
a unique set of error messages, these messages are separate from the warning messages, never null.

getLinkForError

MessageSet.MessageLink getLinkForError(java.lang.String errorMsg)
Parameters:
errorMsg - the unique error message
Returns:
the MessageLink that is associated with the error, if one exists, null otherwise.

getErrorMessagesInEnglish

java.util.Set<java.lang.String> getErrorMessagesInEnglish()
Returns a unique set of all the English error messages.

Returns:
a unique set of all the English error messages.
See Also:
addErrorMessageInEnglish(String)

getWarningMessages

java.util.Set<java.lang.String> getWarningMessages()
Returns:
a unique set of warning messages, these messages are separate from the error messages, never null.

getLinkForWarning

MessageSet.MessageLink getLinkForWarning(java.lang.String warningMsg)
Parameters:
warningMsg - the unique warning message
Returns:
the MessageLink that is associated with the warning, if one exists, null otherwise.

getWarningMessagesInEnglish

java.util.Set<java.lang.String> getWarningMessagesInEnglish()
Returns a unique set of all the English warning messages.

Returns:
a unique set of all the English warning messages.
See Also:
addWarningMessageInEnglish(String)

hasAnyErrors

boolean hasAnyErrors()
Returns true if there are error messages, false otherwise.

Returns:
true if there are error messages, false otherwise.

hasAnyWarnings

boolean hasAnyWarnings()
Returns true if there are warning messages, false otherwise.

Returns:
true if there are warning messages, false otherwise.

hasAnyMessages

boolean hasAnyMessages()
Returns true if there are messages of any type, false otherwise. That is, it will return true if hasAnyErrors() is true or hasAnyWarnings() is true.

Returns:
true if there are messages of any type, false otherwise.

addMessageSet

void addMessageSet(MessageSet messageSet)
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.

addErrorMessage

void addErrorMessage(java.lang.String errorMessage)
Adds an error message.

Parameters:
errorMessage - the message to add.

addErrorMessage

void addErrorMessage(java.lang.String errorMessage,
                     MessageSet.MessageLink link)
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

void addErrorMessageInEnglish(java.lang.String errorMessage)
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:
addErrorMessage(String), addWarningMessageInEnglish(String)

addWarningMessage

void addWarningMessage(java.lang.String warningMessage)
Adds a warning message.

Parameters:
warningMessage - the message to add.

addWarningMessage

void addWarningMessage(java.lang.String warningMessage,
                       MessageSet.MessageLink link)
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

void addWarningMessageInEnglish(java.lang.String warningMessage)
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:
addWarningMessage(String), addErrorMessageInEnglish(String)


Copyright © 2002-2010 Atlassian. All Rights Reserved.