Package com.vaadin.featurepack.server
Class AbstractErrorMessage
java.lang.Object
com.vaadin.featurepack.server.AbstractErrorMessage
- All Implemented Interfaces:
ErrorMessage,Serializable
- Direct Known Subclasses:
CompositeErrorMessage,SystemError,UserError
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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.vaadin.featurepack.server.ErrorMessage
ErrorMessage.ErrorLevel -
Field Summary
Fields inherited from interface com.vaadin.featurepack.server.ErrorMessage
CRITICAL, ERROR, INFORMATION, SYSTEMERROR, WARNING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCause(ErrorMessage cause) protected List<ErrorMessage> Gets the errors level.static ErrorMessageReturns the HTML formatted message to show in as the error message on the client.protected AbstractErrorMessage.ContentModegetMode()static final StringsafeEscapeForHtml(String unsafe) Escapes characters to html entities in Vaadin 7 way.protected voidprotected voidsetErrorLevel(ErrorLevel level) protected voidsetMessage(String message) protected voidtoString()
-
Constructor Details
-
AbstractErrorMessage
-
-
Method Details
-
getMessage
-
setMessage
-
getErrorLevel
Description copied from interface:ErrorMessageGets the errors level.- Specified by:
getErrorLevelin interfaceErrorMessage- Returns:
- the level of error as an integer.
-
setErrorLevel
-
getMode
-
setMode
-
getCauses
-
addCause
-
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.- Specified by:
getFormattedHtmlMessagein interfaceErrorMessage- Returns:
- HTML formatted string for the error message
-
getErrorMessageForException
-
toString
-
safeEscapeForHtml
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
-