public.javadoc.org.spincast.core.validation.ValidationMessageDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
ValidationMessageDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.core.validation
Class ValidationMessageDefault
- java.lang.Object
-
- org.spincast.core.validation.ValidationMessageDefault
-
- All Implemented Interfaces:
- ToJsonObjectConvertible, ValidationMessage
public class ValidationMessageDefault
extends Object
implements ValidationMessage
Validation message implementation.
-
-
Constructor Summary
Constructors
Constructor and Description
ValidationMessageDefault(ValidationLevel validationLevel,
String code,
String text,
ValidationHtmlEscapeType htmlEscapeType,
JsonManager jsonManager)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
JsonObject
convertToJsonObject()
Converts the message to a JsonObject
object.
String
getCode()
The validation code.
ValidationHtmlEscapeType
getHtmlEscapeType()
How should the text be escaped when displayed in
HTML?
protected JsonManager
getJsonManager()
String
getText()
The text of the message.
ValidationLevel
getValidationLevel()
The validation level of thr message :
ERROR, WARNING or SUCCESS.
boolean
isError()
Returns true
if the message level
is ERROR.
boolean
isSuccess()
Returns true
if the message level
is SUCCESS.
boolean
isWarning()
Returns true
if the message level
is WARNING.
String
toString()
-
-
Constructor Detail
-
ValidationMessageDefault
public ValidationMessageDefault(ValidationLevel validationLevel,
String code,
String text,
ValidationHtmlEscapeType htmlEscapeType,
JsonManager jsonManager)
-
Method Detail
-
getText
public String getText()
Description copied from interface: ValidationMessage
The text of the message.
- Specified by:
getText
in interface ValidationMessage
-
getHtmlEscapeType
public ValidationHtmlEscapeType getHtmlEscapeType()
Description copied from interface: ValidationMessage
How should the text be escaped when displayed in
HTML?
- Specified by:
getHtmlEscapeType
in interface ValidationMessage
-
getCode
public String getCode()
Description copied from interface: ValidationMessage
The validation code.
- Specified by:
getCode
in interface ValidationMessage
-
getValidationLevel
public ValidationLevel getValidationLevel()
Description copied from interface: ValidationMessage
The validation level of thr message :
ERROR, WARNING or SUCCESS.
- Specified by:
getValidationLevel
in interface ValidationMessage
-
isWarning
public boolean isWarning()
Description copied from interface: ValidationMessage
Returns true
if the message level
is WARNING.
- Specified by:
isWarning
in interface ValidationMessage
-
isSuccess
public boolean isSuccess()
Description copied from interface: ValidationMessage
Returns true
if the message level
is SUCCESS.
- Specified by:
isSuccess
in interface ValidationMessage
-
isError
public boolean isError()
Description copied from interface: ValidationMessage
Returns true
if the message level
is ERROR.
- Specified by:
isError
in interface ValidationMessage
-
getJsonManager
protected JsonManager getJsonManager()
-
convertToJsonObject
public JsonObject convertToJsonObject()
Description copied from interface: ValidationMessage
Converts the message to a JsonObject
object.
The resulting JsonObject
object
is immutable.
- Specified by:
convertToJsonObject
in interface ToJsonObjectConvertible
- Specified by:
convertToJsonObject
in interface ValidationMessage
Copyright © 2019. All rights reserved.