Class ItemsValidator
java.lang.Object
com.inductiveautomation.ignition.common.jsonschema.BaseJsonValidator
com.inductiveautomation.ignition.common.jsonschema.ItemsValidator
- All Implemented Interfaces:
JsonValidator
A validator (keyed off
items) that either defines a schema for all items in an
arbitrarily long sequence, or a validator with a fixed set of schemas - both the contents
and the number of those child schemas must match to be valid.-
Field Summary
FieldsFields inherited from interface JsonValidator
AT_ROOT -
Constructor Summary
ConstructorsConstructorDescriptionItemsValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema) -
Method Summary
Modifier and TypeMethodDescriptioncom.inductiveautomation.ignition.common.gson.JsonArraycom.inductiveautomation.ignition.common.gson.JsonArrayderiveDefaultArray(boolean includeExample) findSchemaForIndex(int index) Optional<com.inductiveautomation.ignition.common.gson.JsonElement> booleanvalidate(com.inductiveautomation.ignition.common.gson.JsonElement node, com.inductiveautomation.ignition.common.gson.JsonElement rootNode, String at) Validate the given JsonElement, the given node is the child node of the root node at given data path.Methods inherited from class BaseJsonValidator
asInt, buildValidationMessage, debug, equals, getParentSchema, getSchemaNode, getSchemaPath, getSubSchema, getValidatorType, greaterThan, hasSubSchema, lessThan, obtainSubSchemaNode, parseErrorCode, useRefCache, validate
-
Field Details
-
PROPERTY
- See Also:
-
-
Constructor Details
-
ItemsValidator
public ItemsValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema)
-
-
Method Details
-
findSchemaForIndex
-
getSchemas
- Returns:
- a sequence of schemas underneath this validator.
-
isBoundedSchema
public boolean isBoundedSchema()- Returns:
- true if this validator is constrained to a fixed sequence of items, or false if it applies a schema to all items in an arbitrary sequence.
-
validate
public Set<ValidationMessage> validate(com.inductiveautomation.ignition.common.gson.JsonElement node, com.inductiveautomation.ignition.common.gson.JsonElement rootNode, String at) Description copied from interface:JsonValidatorValidate the given JsonElement, the given node is the child node of the root node at given data path.- Parameters:
node- JsonElementrootNode- JsonElementat- String- Returns:
- A list of ValidationMessage if there is any validation error, or an empty list if there is no error.
-
deriveDefaultArray
public com.inductiveautomation.ignition.common.gson.JsonArray deriveDefaultArray() -
deriveDefaultArray
public com.inductiveautomation.ignition.common.gson.JsonArray deriveDefaultArray(boolean includeExample) -
getDefaultItem
-