validator
trestle.core.validator
¤
Base class for all validators.
Attributes¤
logger = logging.getLogger(__name__)
module-attribute
¤
Classes¤
Validator
¤
Bases: ABC
Validator base class.
Source code in trestle/core/validator.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
Functions¤
error_msg()
¤
Error message used to describe this validator.
Source code in trestle/core/validator.py
36 37 38 39 |
|
model_is_valid(model, quiet, trestle_root=None)
abstractmethod
¤
Validate the model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
TopLevelOscalModel
|
An Oscal model that can be passed to the validator. |
required |
quiet
|
bool
|
Don't report msgs unless invalid. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether or not the model passed this validation test. |
Source code in trestle/core/validator.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
validate(args)
¤
Perform the validation according to user options.
Source code in trestle/core/validator.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
handler: python