An abstract field validator interface for validating field values.
More...
#include <cafFieldValidator.h>
|
| enum class | FailureSeverity { VALIDATOR_WARNING
, VALIDATOR_ERROR
, VALIDATOR_CRITICAL
} |
| | The severity of failure. Essentially tells the application how to treat a validator failure: VALIDATOR_WARNING -> user warning VALIDATOR_ERROR -> user error VALIDATOR_CRITICAL -> critical application failure.
|
| |
An abstract field validator interface for validating field values.
◆ FieldValidatorInterface()
| caffa::FieldValidatorInterface::FieldValidatorInterface |
( |
FailureSeverity |
failureSeverity | ) |
|
|
inline |
Construct a new Field Validator Interface object.
- Parameters
-
| failureSeverity | the severity of a validation failure |
◆ failureSeverity()
Get the severity of a failure of the validator.
- Returns
- FailureSeverity
◆ readFromJson()
| virtual void caffa::FieldValidatorInterface::readFromJson |
( |
const nlohmann::json & |
jsonFieldObject, |
|
|
const Serializer & |
serializer |
|
) |
| |
|
pure virtual |
Read the validator from JSON.
- Parameters
-
| jsonFieldObject | the JSON value to read from |
| serializer | the serializer object |
Implemented in caffa::RangeValidator< DataType >.
◆ writeToJson()
| virtual void caffa::FieldValidatorInterface::writeToJson |
( |
nlohmann::json & |
jsonFieldObject, |
|
|
const Serializer & |
serializer |
|
) |
| const |
|
pure virtual |
The documentation for this class was generated from the following file: