public interface MessageFacade
For user messages including general feedback, errors, and field-specific validation errors.
Modifiers | Name | Description |
---|---|---|
class |
MessageFacade.MessageInfo |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addError(java.lang.String error) Add a error message for the user to see. |
|
public void |
addError(ValidationError error) |
|
public void |
addMessage(java.lang.String message) Add a non-error message for internal user to see, for messages not meant for display on public facing sites and portals. |
|
public void |
addMessage(java.lang.String message, NotificationMessage.NotificationType type) Add a message not meant for display on public facing sites and portals. |
|
public void |
addMessage(java.lang.String message, java.lang.String type) A variation on addMessage() where the type is a String instead of NotificationType. |
|
public void |
addPublic(java.lang.String message, NotificationMessage.NotificationType type) Add a message meant for display on public facing sites and portals leaving standard messages and errors for internal applications. |
|
public void |
addPublic(java.lang.String message, java.lang.String type) A variation on addPublic where the type is a String instead of NotificationType. |
|
public void |
addValidationError(java.lang.String form, java.lang.String field, java.lang.String serviceName, java.lang.String message, java.lang.Throwable nested) |
|
public void |
clearAll() Clear all messages: general/internal from addMessage() and public from addPublic(), then calls clearErrors() for errors from addError(), and validation errors from addValidationError() |
|
public void |
clearErrors() Clear error messages including errors from addError(), and validation errors from addValidationError(); before clearing adds these error messages to the general/internal messages list (same as addMessage()) so the messages are not lost and make it back to the user (if applicable) |
|
public void |
copyMessages(MessageFacade mf) Copy all messages from this instance of MessageFacade to another, mostly for internal framework use |
|
public java.util.List<java.lang.String> |
getErrors() Immutable List of error messages that should be shown to internal users. |
|
public java.lang.String |
getErrorsString() Make a single String with all error messages separated by the new-line character. |
|
public java.util.List<MessageInfo> |
getMessageInfos() Immutable List of general (non-error) messages that will be shown to the user. |
|
public java.util.List<java.lang.String> |
getMessages() Immutable List of general (non-error) messages that will be shown to the user. |
|
public java.lang.String |
getMessagesString() Make a single String with all messages separated by the new-line character. |
|
public java.util.List<MessageInfo> |
getPublicMessageInfos() |
|
public java.util.List<java.lang.String> |
getPublicMessages() |
|
public java.util.List<ValidationError> |
getValidationErrors() Immutable List of ValidationError objects that should be shown to internal or public users in the context of the fields that triggered the error. |
|
public boolean |
hasError() See if there is are any errors. |
|
public void |
popErrors() Remove last pushed errors from the stack and add them to current errors, mostly for internal framework use |
|
public void |
pushErrors() Save current errors on a stack and clear them, mostly for internal framework use |
Add a error message for the user to see. NOTE: system errors not meant for the user should be thrown as exceptions instead.
error
- The error message to addAdd a non-error message for internal user to see, for messages not meant for display on public facing sites and portals.
message
- The message to add.Add a message not meant for display on public facing sites and portals.
A variation on addMessage() where the type is a String instead of NotificationType.
type
- String representing one of the NotificationType values: info, success, warning, danger. Defaults to info.Add a message meant for display on public facing sites and portals leaving standard messages and errors for internal applications. Also adds the message like a call to addMessage() for internal and other display so that does not also need to be called.
A variation on addPublic where the type is a String instead of NotificationType. Also adds the message like a call to addMessage() for internal and other display so that does not also need to be called.
type
- String representing one of the NotificationType values: info, success, warning, danger. Defaults to info.Clear all messages: general/internal from addMessage() and public from addPublic(), then calls clearErrors() for errors from addError(), and validation errors from addValidationError()
Clear error messages including errors from addError(), and validation errors from addValidationError(); before clearing adds these error messages to the general/internal messages list (same as addMessage()) so the messages are not lost and make it back to the user (if applicable)
Copy all messages from this instance of MessageFacade to another, mostly for internal framework use
Immutable List of error messages that should be shown to internal users.
Make a single String with all error messages separated by the new-line character.
Immutable List of general (non-error) messages that will be shown to the user.
Immutable List of general (non-error) messages that will be shown to the user.
Make a single String with all messages separated by the new-line character.
Immutable List of ValidationError objects that should be shown to internal or public users in the context of the fields that triggered the error.
See if there is are any errors. Checks both error strings and validation errors.
Remove last pushed errors from the stack and add them to current errors, mostly for internal framework use
Save current errors on a stack and clear them, mostly for internal framework use