Class FormDefault
- All Implemented Interfaces:
Iterable<Map.Entry<String,
,Object>> JsonObject
,JsonObjectOrArray
,Form
,ValidationSet
- Direct Known Subclasses:
ValidationSetSimple
-
Nested Class Summary
Nested classes/interfaces inherited from class org.spincast.core.json.JsonObjectDefault
JsonObjectDefault.IFirstElementGetter<T>
Nested classes/interfaces inherited from class org.spincast.core.json.JsonObjectArrayBase
JsonObjectArrayBase.JsonPathCachingItem
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class org.spincast.core.json.JsonObjectDefault
logger
Fields inherited from class org.spincast.core.json.JsonObjectArrayBase
defaultElementValidator
-
Constructor Summary
ConstructorDescriptionFormDefault
(String formName, JsonObject initialFormData, JsonManager jsonManager, SpincastUtils spincastUtils, ObjectConverter objectConverter, Dictionary dictionary, XmlManager xmlManager, SpincastConfig spincastConfig, Validators validators, FormFactory formFactory, ValidationFactory validationFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates and adds a new Error validation Message.void
addError
(String validationKey, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Creates and adds a new Error validation Message.void
addMessage
(String validationKey, ValidationLevel level, String code, String text) Creates and adds a new validation Message.void
addMessage
(String validationKey, ValidationLevel level, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Creates and adds a new validation Message.void
addMessage
(String validationKey, ValidationMessage message) Adds a new validation Message to this set, using the specified validation key.protected void
addMessageFormattedSpecifickey
(String key, List<ValidationMessage> messages, ValidationMessageFormatType formatType, StringBuilder textBuilder, JsonObject jsonObject) protected void
addMessagesFormattedSpecifickeyHtml
(String key, StringBuilder textBuilder, List<ValidationMessage> messages) protected void
addMessagesFormattedSpecifickeyTextPlain
(String key, StringBuilder textBuilder, List<ValidationMessage> messages) void
addSuccess
(String validationKey, String code, String text) Creates and adds a new Success validation Message.void
addSuccess
(String validationKey, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Creates and adds a new Success validation Message.void
addWarning
(String validationKey, String code, String text) Creates and adds a new Warning validation Message.)void
addWarning
(String validationKey, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Creates and adds a new Warning validation Message.)void
Removes all previously added messages and reset the validation status.Creates a newValidationSet
.protected String
The css class to use for a key's <li> element.protected String
The css class to use for an error message's <li> element.protected String
protected String
protected String
protected Dictionary
protected FormFactory
The name of the form.Gets the validation keys and their associated messages.getMessages
(String key) Gets the validation messages for the specified key.getMessagesFormatted
(String jsonPath, ValidationMessageFormatType formatType) Quick way to get a formatted version of the validation messages for the specified key.getMessagesFormatted
(ValidationMessageFormatType formatType) Quick way to get a formatted version of all validation messages.protected SpincastConfig
protected ValidationFactory
TheJsonObject
in which the validation messages are actually stored.protected String
protected XmlManager
boolean
Does this validation set contain any validation Messages?boolean
hasMessages
(String key) Does the the element at the specified key contains validation Messages?protected void
init()
boolean
isError()
Returnstrue
if the validation set contains at least one ERROR message.boolean
Returnstrue
if the validation set for the element at the specified key contains at least one ERROR message.boolean
Returnstrue
if the validation set only contains SUCCESS messages (or contains no messages at all).boolean
Returnstrue
if the validation set for the element at the specified key only contains SUCCESS messages (or contains no messages at all).boolean
isValid()
Returnstrue
if the validation set does not contain ERROR messages.boolean
Returnstrue
if the validation set for the elements at the specified keys dont not contain ERROR messages.boolean
Returnstrue
if the validation set contains at least one WARNING message, but no ERROR messages.boolean
Returnstrue
if the validation set for the element at the specified key contains at least one WARNING message, but no ERROR messages.mergeValidationSet
(String validationKeyPrefix, ValidationSet validationSet) Merges anotherValidationSet
and prefixes all the validation keys of this set using thevalidationKeyPrefix
.mergeValidationSet
(ValidationSet validationSet) Merges anotherValidationSet
.void
setValidationObject
(JsonObject validationObject) Sets theJsonObject
to use to store the validation messages.int
size()
The size of the object.protected static LinkedHashMap<String,
List<ValidationMessage>> toLinkedHashMap
(String key, List<ValidationMessage> messages) protected static LinkedHashMap<String,
List<ValidationMessage>> toMessages
(List<ValidationSet> existingResults) toString()
protected boolean
protected boolean
Returns theValidators
.Methods inherited from class org.spincast.core.json.JsonObjectDefault
clear, clone, convert, convertToPlainMap, getElementNoKeyParsing, getMap, isElementExistsNoKeyParsing, isEquivalentTo, iterator, merge, merge, merge, merge, merge, putAsIs, remove, removeNoKeyParsing, setNoKeyParsing, setNoKeyParsing, transformAll
Methods inherited from class org.spincast.core.json.JsonObjectArrayBase
clone, contains, getArrayFirst, getArrayFirstBigDecimal, getArrayFirstBigDecimal, getArrayFirstBigDecimal, getArrayFirstBigDecimalNoKeyParsing, getArrayFirstBigDecimalNoKeyParsing, getArrayFirstBoolean, getArrayFirstBoolean, getArrayFirstBoolean, getArrayFirstBooleanNoKeyParsing, getArrayFirstBooleanNoKeyParsing, getArrayFirstBytesFromBase64String, getArrayFirstBytesFromBase64String, getArrayFirstBytesFromBase64String, getArrayFirstBytesFromBase64StringNoKeyParsing, getArrayFirstBytesFromBase64StringNoKeyParsing, getArrayFirstDate, getArrayFirstDate, getArrayFirstDate, getArrayFirstDateNoKeyParsing, getArrayFirstDateNoKeyParsing, getArrayFirstDouble, getArrayFirstDouble, getArrayFirstDouble, getArrayFirstDoubleNoKeyParsing, getArrayFirstDoubleNoKeyParsing, getArrayFirstFloat, getArrayFirstFloat, getArrayFirstFloat, getArrayFirstFloatNoKeyParsing, getArrayFirstFloatNoKeyParsing, getArrayFirstInstant, getArrayFirstInstant, getArrayFirstInstant, getArrayFirstInstantNoKeyParsing, getArrayFirstInstantNoKeyParsing, getArrayFirstInteger, getArrayFirstInteger, getArrayFirstInteger, getArrayFirstIntegerNoKeyParsing, getArrayFirstIntegerNoKeyParsing, getArrayFirstJsonArray, getArrayFirstJsonArray, getArrayFirstJsonArray, getArrayFirstJsonArrayNoKeyParsing, getArrayFirstJsonArrayNoKeyParsing, getArrayFirstJsonObject, getArrayFirstJsonObject, getArrayFirstJsonObject, getArrayFirstJsonObjectNoKeyParsing, getArrayFirstJsonObjectNoKeyParsing, getArrayFirstLong, getArrayFirstLong, getArrayFirstLong, getArrayFirstLongNoKeyParsing, getArrayFirstLongNoKeyParsing, getArrayFirstString, getArrayFirstString, getArrayFirstString, getArrayFirstStringNoKeyParsing, getArrayFirstStringNoKeyParsing, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimalElement, getBigDecimalFromObject, getBigDecimalNoKeyParsing, getBigDecimalNoKeyParsing, getBoolean, getBoolean, getBoolean, getBooleanElement, getBooleanFromObject, getBooleanNoKeyParsing, getBooleanNoKeyParsing, getBytesFromBase64String, getBytesFromBase64String, getBytesFromBase64String, getBytesFromBase64StringElement, getBytesFromBase64StringNoKeyParsing, getBytesFromBase64StringNoKeyParsing, getBytesFromBase64StringValueFromObject, getDate, getDate, getDate, getDateElement, getDateFromObject, getDateNoKeyParsing, getDateNoKeyParsing, getdefaultElementValidator, getDouble, getDouble, getDouble, getDoubleElement, getDoubleFromObject, getDoubleNoKeyParsing, getDoubleNoKeyParsing, getElement, getFloat, getFloat, getFloat, getFloatElement, getFloatFromObject, getFloatNoKeyParsing, getFloatNoKeyParsing, getInstant, getInstant, getInstant, getInstantElement, getInstantFromObject, getInstantNoKeyParsing, getInstantNoKeyParsing, getInteger, getInteger, getInteger, getIntegerElement, getIntegerFromObject, getIntegerNoKeyParsing, getIntegerNoKeyParsing, getJsonArray, getJsonArray, getJsonArray, getJsonArrayFromObject, getJsonArrayNoKeyParsing, getJsonArrayNoKeyParsing, getJsonArrayOrEmpty, getJsonArrayOrEmpty, getJsonArrayOrEmptyNoKeyParsing, getJsonManager, getJsonObject, getJsonObject, getJsonObject, getJsonObject, getJsonObjectFromObject, getJsonObjectNoKeyParsing, getJsonObjectNoKeyParsing, getJsonObjectOrEmpty, getJsonObjectOrEmpty, getJsonObjectOrEmptyNoKeyParsing, getJsonPathCachingMap, getLong, getLong, getLong, getLongElement, getLongFromObject, getLongNoKeyParsing, getLongNoKeyParsing, getObject, getObject, getObject, getObjectConverter, getObjectNoKeyParsing, getObjectNoKeyParsing, getSpincastUtils, getString, getString, getString, getString, getStringFromObject, getStringNoKeyParsing, getStringNoKeyParsing, getTrimTransformer, isCanBeConvertedToBigDecimal, isCanBeConvertedToBigDecimal, isCanBeConvertedToBigDecimalNoKeyParsing, isCanBeConvertedToBoolean, isCanBeConvertedToBoolean, isCanBeConvertedToBooleanNoKeyParsing, isCanBeConvertedToByteArray, isCanBeConvertedToByteArray, isCanBeConvertedToByteArrayNoKeyParsing, isCanBeConvertedToDate, isCanBeConvertedToDate, isCanBeConvertedToDateNoKeyParsing, isCanBeConvertedToDouble, isCanBeConvertedToDouble, isCanBeConvertedToDoubleNoKeyParsing, isCanBeConvertedToFloat, isCanBeConvertedToFloat, isCanBeConvertedToFloatNoKeyParsing, isCanBeConvertedToInteger, isCanBeConvertedToInteger, isCanBeConvertedToIntegerNoKeyParsing, isCanBeConvertedToJsonArray, isCanBeConvertedToJsonArray, isCanBeConvertedToJsonArrayNoKeyParsing, isCanBeConvertedToJsonObject, isCanBeConvertedToJsonObject, isCanBeConvertedToJsonObjectNoKeyParsing, isCanBeConvertedToLong, isCanBeConvertedToLong, isCanBeConvertedToLongNoKeyParsing, isCanBeConvertedToString, isCanBeConvertedToString, isCanBeConvertedToStringNoKeyParsing, isMutable, isNull, isNullNoKeyParsing, isOfTypeBigDecimal, isOfTypeBigDecimalNoKeyParsing, isOfTypeBoolean, isOfTypeBoolean, isOfTypeBooleanNoKeyParsing, isOfTypeByteArray, isOfTypeByteArray, isOfTypeByteArrayNoKeyParsing, isOfTypeDate, isOfTypeDate, isOfTypeDateNoKeyParsing, isOfTypeDouble, isOfTypeDouble, isOfTypeDoubleNoKeyParsing, isOfTypeeBigDecimal, isOfTypeFloat, isOfTypeFloat, isOfTypeFloatNoKeyParsing, isOfTypeInteger, isOfTypeInteger, isOfTypeIntegerNoKeyParsing, isOfTypeJsonArray, isOfTypeJsonArray, isOfTypeJsonArrayNoKeyParsing, isOfTypeJsonObject, isOfTypeJsonObject, isOfTypeJsonObjectNoKeyParsing, isOfTypeLong, isOfTypeLong, isOfTypeLongNoKeyParsing, isOfTypeString, isOfTypeString, isOfTypeStringNoKeyParsing, isPresent, put, set, set, setIfAbsent, setIfAbsent, toJsonString, toJsonString, transform, transformAll, trim, trimAll, trimAll, validateIsNull
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.spincast.core.json.JsonObject
clone, convert, convertToPlainMap, getArrayFirstBigDecimalNoKeyParsing, getArrayFirstBigDecimalNoKeyParsing, getArrayFirstBooleanNoKeyParsing, getArrayFirstBooleanNoKeyParsing, getArrayFirstBytesFromBase64StringNoKeyParsing, getArrayFirstBytesFromBase64StringNoKeyParsing, getArrayFirstDateNoKeyParsing, getArrayFirstDateNoKeyParsing, getArrayFirstDoubleNoKeyParsing, getArrayFirstDoubleNoKeyParsing, getArrayFirstFloatNoKeyParsing, getArrayFirstFloatNoKeyParsing, getArrayFirstIntegerNoKeyParsing, getArrayFirstIntegerNoKeyParsing, getArrayFirstJsonArrayNoKeyParsing, getArrayFirstJsonArrayNoKeyParsing, getArrayFirstJsonObjectNoKeyParsing, getArrayFirstJsonObjectNoKeyParsing, getArrayFirstLongNoKeyParsing, getArrayFirstLongNoKeyParsing, getArrayFirstStringNoKeyParsing, getArrayFirstStringNoKeyParsing, getBigDecimalNoKeyParsing, getBigDecimalNoKeyParsing, getBooleanNoKeyParsing, getBooleanNoKeyParsing, getBytesFromBase64StringNoKeyParsing, getBytesFromBase64StringNoKeyParsing, getDateNoKeyParsing, getDateNoKeyParsing, getDoubleNoKeyParsing, getDoubleNoKeyParsing, getFloatNoKeyParsing, getFloatNoKeyParsing, getInstantNoKeyParsing, getInstantNoKeyParsing, getIntegerNoKeyParsing, getIntegerNoKeyParsing, getJsonArrayNoKeyParsing, getJsonArrayNoKeyParsing, getJsonArrayOrEmptyNoKeyParsing, getJsonObjectNoKeyParsing, getJsonObjectNoKeyParsing, getJsonObjectOrEmptyNoKeyParsing, getLongNoKeyParsing, getLongNoKeyParsing, getObjectNoKeyParsing, getObjectNoKeyParsing, getStringNoKeyParsing, getStringNoKeyParsing, isCanBeConvertedToBigDecimalNoKeyParsing, isCanBeConvertedToBooleanNoKeyParsing, isCanBeConvertedToByteArrayNoKeyParsing, isCanBeConvertedToDateNoKeyParsing, isCanBeConvertedToDoubleNoKeyParsing, isCanBeConvertedToFloatNoKeyParsing, isCanBeConvertedToIntegerNoKeyParsing, isCanBeConvertedToJsonArrayNoKeyParsing, isCanBeConvertedToJsonObjectNoKeyParsing, isCanBeConvertedToLongNoKeyParsing, isCanBeConvertedToStringNoKeyParsing, isElementExistsNoKeyParsing, isEquivalentTo, isNullNoKeyParsing, isOfTypeBigDecimalNoKeyParsing, isOfTypeBooleanNoKeyParsing, isOfTypeByteArrayNoKeyParsing, isOfTypeDateNoKeyParsing, isOfTypeDoubleNoKeyParsing, isOfTypeFloatNoKeyParsing, isOfTypeIntegerNoKeyParsing, isOfTypeJsonArrayNoKeyParsing, isOfTypeJsonObjectNoKeyParsing, isOfTypeLongNoKeyParsing, isOfTypeStringNoKeyParsing, merge, merge, merge, merge, merge, removeNoKeyParsing, setNoKeyParsing, setNoKeyParsing
Methods inherited from interface org.spincast.core.json.JsonObjectOrArray
clear, contains, getArrayFirstBigDecimal, getArrayFirstBigDecimal, getArrayFirstBoolean, getArrayFirstBoolean, getArrayFirstBytesFromBase64String, getArrayFirstBytesFromBase64String, getArrayFirstDate, getArrayFirstDate, getArrayFirstDouble, getArrayFirstDouble, getArrayFirstFloat, getArrayFirstFloat, getArrayFirstInstant, getArrayFirstInstant, getArrayFirstInteger, getArrayFirstInteger, getArrayFirstJsonArray, getArrayFirstJsonArray, getArrayFirstJsonObject, getArrayFirstJsonObject, getArrayFirstLong, getArrayFirstLong, getArrayFirstString, getArrayFirstString, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getBytesFromBase64String, getBytesFromBase64String, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInstant, getInstant, getInteger, getInteger, getJsonArray, getJsonArray, getJsonArrayOrEmpty, getJsonArrayOrEmpty, getJsonObject, getJsonObject, getJsonObjectOrEmpty, getJsonObjectOrEmpty, getLong, getLong, getObject, getObject, getString, getString, isCanBeConvertedToBigDecimal, isCanBeConvertedToBoolean, isCanBeConvertedToByteArray, isCanBeConvertedToDate, isCanBeConvertedToDouble, isCanBeConvertedToFloat, isCanBeConvertedToInteger, isCanBeConvertedToJsonArray, isCanBeConvertedToJsonObject, isCanBeConvertedToLong, isCanBeConvertedToString, isMutable, isNull, isOfTypeBigDecimal, isOfTypeBoolean, isOfTypeByteArray, isOfTypeDate, isOfTypeDouble, isOfTypeFloat, isOfTypeInteger, isOfTypeJsonArray, isOfTypeJsonObject, isOfTypeLong, isOfTypeString, isPresent, remove, set, set, setIfAbsent, setIfAbsent, toJsonString, toJsonString, transform, transformAll, transformAll, trim, trimAll, trimAll
-
Field Details
-
ELEMENT_KEYS_IS_VALID
- See Also:
-
ELEMENT_KEYS_HAS_SUCCESSES
- See Also:
-
ELEMENT_KEYS_HAS_WARNINGS
- See Also:
-
ELEMENT_KEYS_HAS_ERRORS
- See Also:
-
-
Constructor Details
-
FormDefault
public FormDefault(String formName, @Nullable JsonObject initialFormData, JsonManager jsonManager, SpincastUtils spincastUtils, ObjectConverter objectConverter, Dictionary dictionary, XmlManager xmlManager, SpincastConfig spincastConfig, Validators validators, FormFactory formFactory, ValidationFactory validationFactory)
-
-
Method Details
-
init
@Inject protected void init() -
getFormName
Description copied from interface:Form
The name of the form.- Specified by:
getFormName
in interfaceForm
-
getDictionary
-
getXmlManager
-
getSpincastConfig
-
getFormFactory
-
getValidationFactory
-
validators
Description copied from interface:Form
Returns theValidators
.- Specified by:
validators
in interfaceForm
-
getDefaultErrorMessageText
-
toLinkedHashMap
protected static LinkedHashMap<String,List<ValidationMessage>> toLinkedHashMap(String key, List<ValidationMessage> messages) -
toMessages
protected static LinkedHashMap<String,List<ValidationMessage>> toMessages(List<ValidationSet> existingResults) -
getWholeValidationKey
-
getValidationResultAsJsonObject
Description copied from interface:ValidationSet
TheJsonObject
in which the validation messages are actually stored.You can use this object to return the validation result as json, in a response.
- Specified by:
getValidationResultAsJsonObject
in interfaceValidationSet
-
setValidationObject
Description copied from interface:Form
Sets theJsonObject
to use to store the validation messages.If there are existing validation messages on the current validation object, they will be merged to the new object!
Beware that changing this object may disconnect the validation messages of this form from a global validation element on the response's model!
- Specified by:
setValidationObject
in interfaceForm
-
addMessage
Description copied from interface:ValidationSet
Adds a new validation Message to this set, using the specified validation key.- Specified by:
addMessage
in interfaceValidationSet
-
addMessage
Description copied from interface:ValidationSet
Creates and adds a new validation Message.Escapes the message in
<pre>
tags if displayed in HTML.- Specified by:
addMessage
in interfaceValidationSet
-
addMessage
public void addMessage(String validationKey, ValidationLevel level, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Description copied from interface:ValidationSet
Creates and adds a new validation Message.- Specified by:
addMessage
in interfaceValidationSet
-
addError
Description copied from interface:ValidationSet
Creates and adds a new Error validation Message.Escapes the message in
<pre>
tags if displayed in HTML.- Specified by:
addError
in interfaceValidationSet
-
addError
public void addError(String validationKey, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Description copied from interface:ValidationSet
Creates and adds a new Error validation Message.- Specified by:
addError
in interfaceValidationSet
-
addWarning
Description copied from interface:ValidationSet
Creates and adds a new Warning validation Message.)Escapes the message in
<pre>
tags if displayed in HTML.- Specified by:
addWarning
in interfaceValidationSet
-
addWarning
public void addWarning(String validationKey, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Description copied from interface:ValidationSet
Creates and adds a new Warning validation Message.)- Specified by:
addWarning
in interfaceValidationSet
-
addSuccess
Description copied from interface:ValidationSet
Creates and adds a new Success validation Message.Escapes the message in
<pre>
tags if displayed in HTML.- Specified by:
addSuccess
in interfaceValidationSet
-
addSuccess
public void addSuccess(String validationKey, String code, String text, ValidationHtmlEscapeType htmlEscapeType) Description copied from interface:ValidationSet
Creates and adds a new Success validation Message.- Specified by:
addSuccess
in interfaceValidationSet
htmlEscapeType
- if this message if displayed usingHTML
, should should it be escaped?
-
hasMessages
public boolean hasMessages()Description copied from interface:ValidationSet
Does this validation set contain any validation Messages?- Specified by:
hasMessages
in interfaceValidationSet
-
hasMessages
Description copied from interface:ValidationSet
Does the the element at the specified key contains validation Messages?- Specified by:
hasMessages
in interfaceValidationSet
-
isWarning
public boolean isWarning()Description copied from interface:ValidationSet
Returnstrue
if the validation set contains at least one WARNING message, but no ERROR messages.- Specified by:
isWarning
in interfaceValidationSet
-
isWarning
Description copied from interface:ValidationSet
Returnstrue
if the validation set for the element at the specified key contains at least one WARNING message, but no ERROR messages.- Specified by:
isWarning
in interfaceValidationSet
-
isSuccess
public boolean isSuccess()Description copied from interface:ValidationSet
Returnstrue
if the validation set only contains SUCCESS messages (or contains no messages at all).- Specified by:
isSuccess
in interfaceValidationSet
-
isSuccess
Description copied from interface:ValidationSet
Returnstrue
if the validation set for the element at the specified key only contains SUCCESS messages (or contains no messages at all).- Specified by:
isSuccess
in interfaceValidationSet
-
isError
public boolean isError()Description copied from interface:ValidationSet
Returnstrue
if the validation set contains at least one ERROR message.- Specified by:
isError
in interfaceValidationSet
-
isError
Description copied from interface:ValidationSet
Returnstrue
if the validation set for the element at the specified key contains at least one ERROR message.- Specified by:
isError
in interfaceValidationSet
-
isValid
public boolean isValid()Description copied from interface:ValidationSet
Returnstrue
if the validation set does not contain ERROR messages. The set may contain WARNING messages.This is a synonym of
!isError()
.- Specified by:
isValid
in interfaceValidationSet
-
isValid
Description copied from interface:ValidationSet
Returnstrue
if the validation set for the elements at the specified keys dont not contain ERROR messages.The elements may contains WARNING messages.
If no keys are passed, then all keys must be valid (synonym of
ValidationSet.isValid()
.- Specified by:
isValid
in interfaceValidationSet
-
getMessages
Description copied from interface:ValidationSet
Gets the validation keys and their associated messages.The Map and the lists are immutable.
- Specified by:
getMessages
in interfaceValidationSet
-
getMessages
Description copied from interface:ValidationSet
Gets the validation messages for the specified key.The list is immutable.
- Specified by:
getMessages
in interfaceValidationSet
-
getMessagesFormatted
Description copied from interface:ValidationSet
Quick way to get a formatted version of all validation messages.- Specified by:
getMessagesFormatted
in interfaceValidationSet
- Parameters:
formatType
- The type of output for the messages (Text, HTML, Json or XML).- Returns:
- the formatted messages or
null
if there are no validation messages.
-
getMessagesFormatted
Description copied from interface:ValidationSet
Quick way to get a formatted version of the validation messages for the specified key.- Specified by:
getMessagesFormatted
in interfaceValidationSet
formatType
- The type of output for the messages (Text, HTML, Json or XML).- Returns:
- the formatted messages or
null
if there are no validation messages.
-
usePrettyJson
protected boolean usePrettyJson() -
usePrettyXml
protected boolean usePrettyXml() -
addMessageFormattedSpecifickey
protected void addMessageFormattedSpecifickey(String key, List<ValidationMessage> messages, ValidationMessageFormatType formatType, StringBuilder textBuilder, JsonObject jsonObject) -
addMessagesFormattedSpecifickeyTextPlain
protected void addMessagesFormattedSpecifickeyTextPlain(String key, StringBuilder textBuilder, List<ValidationMessage> messages) -
addMessagesFormattedSpecifickeyHtml
protected void addMessagesFormattedSpecifickeyHtml(String key, StringBuilder textBuilder, List<ValidationMessage> messages) -
getCssClassForErrorkey
The css class to use for a key's <li> element. -
getCssClassForErrorMessage
The css class to use for an error message's <li> element. -
getCssClassForSuccessMessage
-
getCssClassForWarningMessage
-
createNewValidationSet
Description copied from interface:ValidationSet
Creates a newValidationSet
.- Specified by:
createNewValidationSet
in interfaceValidationSet
-
mergeValidationSet
Description copied from interface:ValidationSet
Merges anotherValidationSet
.- Specified by:
mergeValidationSet
in interfaceValidationSet
- Returns:
- this, fluent-style.
-
mergeValidationSet
Description copied from interface:ValidationSet
Merges anotherValidationSet
and prefixes all the validation keys of this set using thevalidationKeyPrefix
.- Specified by:
mergeValidationSet
in interfaceValidationSet
- Returns:
- this, fluent-style.
-
size
public int size()Description copied from interface:JsonObjectOrArray
The size of the object.- Specified by:
size
in interfaceJsonObjectOrArray
- Specified by:
size
in interfaceValidationSet
- Overrides:
size
in classJsonObjectDefault
-
clearAllValidation
public void clearAllValidation()Description copied from interface:ValidationSet
Removes all previously added messages and reset the validation status.- Specified by:
clearAllValidation
in interfaceValidationSet
-
toString
- Overrides:
toString
in classJsonObjectArrayBase
-