com.vaadin.server.
Class AbstractErrorMessage
- java.lang.Object
-
- com.vaadin.server.AbstractErrorMessage
-
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class AbstractErrorMessage extends Object implements ErrorMessage
Base class for component error messages. This class is used on the server side to construct the error messages to send to the client.
Since:
7.0
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractErrorMessage.ContentMode
-
Field Summary
-
Fields inherited from interface com.vaadin.server.ErrorMessage
CRITICAL, ERROR, INFORMATION, SYSTEMERROR, WARNING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractErrorMessage(String message)
-
Method Summary
All Methods Modifier and Type Method Description void
addCause(ErrorMessage cause)
protected List<ErrorMessage>
getCauses()
ErrorLevel
getErrorLevel()
Gets the errors level.
static ErrorMessage
getErrorMessageForException(Throwable t)
String
getFormattedHtmlMessage()
Returns the HTML formatted message to show in as the error message on the client.
String
getMessage()
protected AbstractErrorMessage.ContentMode
getMode()
void
setErrorLevel(ErrorLevel level)
protected void
setMessage(String message)
protected void
setMode(AbstractErrorMessage.ContentMode mode)
String
toString()
-
-
-
Constructor Detail
-
AbstractErrorMessage
protected AbstractErrorMessage(String message)
-
-
Method Detail
-
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 interfaceErrorMessage
Returns:
the level of error as an integer.
-
setErrorLevel
public void setErrorLevel(ErrorLevel level)
-
getMode
protected AbstractErrorMessage.ContentMode getMode()
-
setMode
protected void setMode(AbstractErrorMessage.ContentMode mode)
-
getCauses
protected List<ErrorMessage> getCauses()
-
addCause
public 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. TODO this API may still change to use a separate data transfer object
Specified by:
getFormattedHtmlMessage
in interfaceErrorMessage
Returns:
HTML formatted string for the error message
-
getErrorMessageForException
public static ErrorMessage getErrorMessageForException(Throwable t)
-
-