public interface ValidationBuilderCoreBase<T extends ValidationBuilderCoreBase<?>>
| Modifier and Type | Method and Description |
|---|---|
T |
addMessageOnSuccess()
If the validation is successful, the validator should add
a Success Message.
|
T |
addMessageOnSuccess(String customSuccessMessageText)
If the validation is successful, the validator should add
a Success Message.
|
T |
code(String code)
Modifies the default validation code.
|
T |
failMessageText(String customFailMessageText)
Instead of the default one, use the specified text
for the validation Message in case of a failure.
|
T |
treatErrorAsWarning()
If this is called, a validation failure will result in
a Warning level Message instead of an Error level Message.
|
ValidationSet |
validate()
Performs the validation, saves the result into the
validation set and returns it.
|
ValidationSet |
validate(boolean onlyIfNoMessageYet)
Performs the validation, saves the result into the
validation set and returns it.
|
ValidationSet |
validate(ValidationLevel onlyIfNoMessageAtThisLevelOrHigherYet)
Performs the validation, saves the result into the
validation set and returns it.
|
T addMessageOnSuccess()
T addMessageOnSuccess(String customSuccessMessageText)
customSuccessMessageText - The text to use for
the Message instead of the default one.T treatErrorAsWarning()
Please remember that an object with Warnings validation messages and no Error Messages is considered as valid!
T failMessageText(String customFailMessageText)
Note that this text will be used for Errors but also
for Warning Message text is treatErrorAsWarning()
has been called.
ValidationSet validate()
ValidationSet validate(boolean onlyIfNoMessageYet)
onlyIfNoMessageYet - if true, the validation
will be performs only if no Message already exists
for the validation key. This is a synonym to calling
validate(ValidationLevel.SUCCESS).ValidationSet validate(ValidationLevel onlyIfNoMessageAtThisLevelOrHigherYet)
onlyIfNoMessageYet - The validation
will be performs only if no Message at the specified
ValidationLevel or higher already exists
for the validation key.
validate(ValidationLevel.SUCCESS) : The validation will
be perform only if no messages at all already exist for that
validation key.
validate(ValidationLevel.WARNING) : The validation will
be perform only if no WARNING or ERROR messages
already exist for that validation key.
validate(ValidationLevel.ERROR) : The validation will
be perform only if no ERROR messages already exist for
that validation key.
Copyright © 2016. All rights reserved.