Package org.spincast.core.validation
Class ValidationMessageDefault
java.lang.Object
org.spincast.core.validation.ValidationMessageDefault
- All Implemented Interfaces:
ToJsonObjectConvertible
,ValidationMessage
Validation message implementation.
-
Constructor Summary
ConstructorDescriptionValidationMessageDefault
(ValidationLevel validationLevel, String code, String text, ValidationHtmlEscapeType htmlEscapeType, JsonManager jsonManager) -
Method Summary
Modifier and TypeMethodDescriptionConverts the message to aJsonObject
object.getCode()
The validation code.How should the text be escaped when displayed in HTML?protected JsonManager
getText()
The text of the message.The validation level of thr message : ERROR, WARNING or SUCCESS.boolean
isError()
Returnstrue
if the message level is ERROR.boolean
Returnstrue
if the message level is SUCCESS.boolean
Returnstrue
if the message level is WARNING.toString()
-
Constructor Details
-
ValidationMessageDefault
public ValidationMessageDefault(ValidationLevel validationLevel, String code, String text, ValidationHtmlEscapeType htmlEscapeType, JsonManager jsonManager)
-
-
Method Details
-
getText
Description copied from interface:ValidationMessage
The text of the message.- Specified by:
getText
in interfaceValidationMessage
-
getHtmlEscapeType
Description copied from interface:ValidationMessage
How should the text be escaped when displayed in HTML?- Specified by:
getHtmlEscapeType
in interfaceValidationMessage
-
getCode
Description copied from interface:ValidationMessage
The validation code.- Specified by:
getCode
in interfaceValidationMessage
-
getValidationLevel
Description copied from interface:ValidationMessage
The validation level of thr message : ERROR, WARNING or SUCCESS.- Specified by:
getValidationLevel
in interfaceValidationMessage
-
isWarning
public boolean isWarning()Description copied from interface:ValidationMessage
Returnstrue
if the message level is WARNING.- Specified by:
isWarning
in interfaceValidationMessage
-
isSuccess
public boolean isSuccess()Description copied from interface:ValidationMessage
Returnstrue
if the message level is SUCCESS.- Specified by:
isSuccess
in interfaceValidationMessage
-
isError
public boolean isError()Description copied from interface:ValidationMessage
Returnstrue
if the message level is ERROR.- Specified by:
isError
in interfaceValidationMessage
-
getJsonManager
-
convertToJsonObject
Description copied from interface:ValidationMessage
Converts the message to aJsonObject
object.The resulting
JsonObject
object is immutable.- Specified by:
convertToJsonObject
in interfaceToJsonObjectConvertible
- Specified by:
convertToJsonObject
in interfaceValidationMessage
-
toString
-