Class AbstractErrorMessage

java.lang.Object
com.vaadin.featurepack.server.AbstractErrorMessage
All Implemented Interfaces:
ErrorMessage, Serializable
Direct Known Subclasses:
CompositeErrorMessage, SystemError, UserError

public class AbstractErrorMessage extends Object implements ErrorMessage
Base Vaadin 7/8 class for component error messages. This class is used on the server side to construct the error messages to send to the client.
See Also:
  • Constructor Details

    • AbstractErrorMessage

      protected AbstractErrorMessage(String message)
  • Method Details

    • getMessage

      public String getMessage()
    • setMessage

      protected void setMessage(String message)
    • getErrorLevel

      public ErrorLevel getErrorLevel()
      Description copied from interface: ErrorMessage
      Gets the errors level.
      Specified by:
      getErrorLevel in interface ErrorMessage
      Returns:
      the level of error as an integer.
    • setErrorLevel

      protected void setErrorLevel(ErrorLevel level)
    • setErrorLevel

      protected void setErrorLevel(ErrorMessage.ErrorLevel level)
    • getMode

      protected AbstractErrorMessage.ContentMode getMode()
    • setMode

      protected void setMode(AbstractErrorMessage.ContentMode mode)
    • getCauses

      protected List<ErrorMessage> getCauses()
    • addCause

      protected void addCause(ErrorMessage cause)
    • getFormattedHtmlMessage

      public String getFormattedHtmlMessage()
      Description copied from interface: ErrorMessage
      Returns the HTML formatted message to show in as the error message on the client. This method should perform any necessary escaping to avoid XSS attacks.
      Specified by:
      getFormattedHtmlMessage in interface ErrorMessage
      Returns:
      HTML formatted string for the error message
    • getErrorMessageForException

      public static ErrorMessage getErrorMessageForException(Throwable t)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • safeEscapeForHtml

      public static final String safeEscapeForHtml(String unsafe)
      Escapes characters to html entities in Vaadin 7 way. An exception is made for some "safe characters" to keep the text somewhat readable.
      Parameters:
      unsafe -
      Returns:
      a safe string to be added inside an html tag