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
ConstructorsConstructorDescriptionValidationMessageDefault(ValidationLevel validationLevel, String code, String text, ValidationHtmlEscapeType htmlEscapeType, JsonManager jsonManager) -
Method Summary
Modifier and TypeMethodDescriptionConverts the message to aJsonObjectobject.getCode()The validation code.How should the text be escaped when displayed in HTML?protected JsonManagergetText()The text of the message.The validation level of thr message : ERROR, WARNING or SUCCESS.booleanisError()Returnstrueif the message level is ERROR.booleanReturnstrueif the message level is SUCCESS.booleanReturnstrueif 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:ValidationMessageThe text of the message.- Specified by:
getTextin interfaceValidationMessage
-
getHtmlEscapeType
Description copied from interface:ValidationMessageHow should the text be escaped when displayed in HTML?- Specified by:
getHtmlEscapeTypein interfaceValidationMessage
-
getCode
Description copied from interface:ValidationMessageThe validation code.- Specified by:
getCodein interfaceValidationMessage
-
getValidationLevel
Description copied from interface:ValidationMessageThe validation level of thr message : ERROR, WARNING or SUCCESS.- Specified by:
getValidationLevelin interfaceValidationMessage
-
isWarning
public boolean isWarning()Description copied from interface:ValidationMessageReturnstrueif the message level is WARNING.- Specified by:
isWarningin interfaceValidationMessage
-
isSuccess
public boolean isSuccess()Description copied from interface:ValidationMessageReturnstrueif the message level is SUCCESS.- Specified by:
isSuccessin interfaceValidationMessage
-
isError
public boolean isError()Description copied from interface:ValidationMessageReturnstrueif the message level is ERROR.- Specified by:
isErrorin interfaceValidationMessage
-
getJsonManager
-
convertToJsonObject
Description copied from interface:ValidationMessageConverts the message to aJsonObjectobject.The resulting
JsonObjectobject is immutable.- Specified by:
convertToJsonObjectin interfaceToJsonObjectConvertible- Specified by:
convertToJsonObjectin interfaceValidationMessage
-
toString
-