Class ActionMessage


  • public class ActionMessage
    extends Object
    Represents an action message. Used in conjunction with ActionMessages
    Since:
    5.0
    See Also:
    ActionMessages
    • Constructor Detail

      • ActionMessage

        public ActionMessage​(@NotNull
                             String key,
                             @NotNull
                             String message)
        Create an action message object with the specified key, body and warning flag set to false.

        The caller cannot pass raw HTML message using this constructor, as the message will be escaped.

        Parameters:
        key - the key
        message - the message body
        See Also:
        ActionMessages.addRawMessage(String, String, String...)
      • ActionMessage

        public ActionMessage​(@NotNull
                             String key,
                             @NotNull
                             String message,
                             boolean isWarning,
                             @NotNull
                             String... parameters)
        Create an action message object with the specified key, body and warning flag. Message body can contain placeholders for parameters.

        The caller cannot pass raw HTML message using this constructor, as the message and parameters will be escaped.

        Parameters:
        key - message key
        message - message
        isWarning - the warning flag (by default will be displayed as warning)
        parameters - if specified then substrings like {0}, {1}, {2} and so on will be replaced with parameter with corresponding index. Each parameter will be passed through WebUtil.escapeXml(String) function before inserted into the resulting message.
        See Also:
        ActionMessages.addRawMessage(String, String, String...)
      • ActionMessage

        public ActionMessage​(@NotNull
                             String key,
                             @NotNull
                             String message,
                             @NotNull
                             String... parameters)
        Create an action message object with the specified key, body and warning flag set to false. Message body can contain placeholders for parameters.

        The caller cannot pass raw HTML message using this constructor, as the message and parameters will be escaped.

        Parameters:
        key - message key
        message - message
        parameters - if specified then substrings like {0}, {1}, {2} and so on will be replaced with parameter with corresponding index. Each parameter will be passed through WebUtil.escapeXml(String) function before inserted into the resulting message.
        See Also:
        ActionMessages.addRawMessage(String, String, String...)
    • Method Detail

      • getKey

        @NotNull
        public String getKey()
      • getMessage

        @NotNull
        public String getMessage()
      • isIsWarning

        public boolean isIsWarning()