returns: Variant
The class that defines what restrictions a given property has. This class itself does not apply any test to the user input, but every other property extends from this one.
In this example, the configuration structure has one required property. The property 'anything' can be absolutely anything.
# Create a JSON configuration file
var json_config_file = JSONConfigFile.new()
# Add a 'anything' property, which is can be absolutly anything
json_config_file.add_property("anything", JSONProperty.new())
# Validate input
json_config_file.validate(json_file_path)A string is valid:
{
"anything": "This can take any value"
}A 'null' is valid:
{
"anything": null
}An object is valid:
{
"anything": {
"absolutely": "Any kind of value"
}
}The public methods of this class are:
| Name | Params | Description | Returns |
|---|---|---|---|
| set_preprocessor | processor -> JSONConfigProcessor: Object that defines the function to execute before the validation process. |
Sets the process to execute before the validation process. | Nothing. |
| set_postprocessor | processor -> JSONConfigProcessor: Object that defines the function to execute after the validation process. |
Sets the process to execute after the validation process. | Nothing. |