Package com.vaadin.server
Class AbstractErrorMessage
- java.lang.Object
-
- com.vaadin.server.AbstractErrorMessage
-
- All Implemented Interfaces:
ErrorMessage,Serializable
- Direct Known Subclasses:
CompositeErrorMessage,SystemError,UserError
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractErrorMessage.ContentMode-
Nested classes/interfaces inherited from interface com.vaadin.server.ErrorMessage
ErrorMessage.ErrorLevel
-
-
Field Summary
-
Fields inherited from interface com.vaadin.server.ErrorMessage
CRITICAL, ERROR, INFORMATION, SYSTEMERROR, WARNING
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractErrorMessage(String message)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCause(ErrorMessage cause)protected List<ErrorMessage>getCauses()ErrorMessage.ErrorLevelgetErrorLevel()Gets the errors level.static ErrorMessagegetErrorMessageForException(Throwable t)StringgetFormattedHtmlMessage()Returns the HTML formatted message to show in as the error message on the client.StringgetMessage()protected AbstractErrorMessage.ContentModegetMode()protected voidsetErrorLevel(ErrorMessage.ErrorLevel level)protected voidsetMessage(String message)protected voidsetMode(AbstractErrorMessage.ContentMode mode)StringtoString()
-
-
-
Constructor Detail
-
AbstractErrorMessage
protected AbstractErrorMessage(String message)
-
-
Method Detail
-
getMessage
public String getMessage()
-
setMessage
protected void setMessage(String message)
-
getErrorLevel
public ErrorMessage.ErrorLevel getErrorLevel()
Description copied from interface:ErrorMessageGets the errors level.- Specified by:
getErrorLevelin interfaceErrorMessage- Returns:
- the level of error as an integer.
-
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:ErrorMessageReturns 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:
getFormattedHtmlMessagein interfaceErrorMessage- Returns:
- HTML formatted string for the error message
-
getErrorMessageForException
public static ErrorMessage getErrorMessageForException(Throwable t)
-
-