java.lang.Object
com.inductiveautomation.ignition.common.jsonschema.BaseJsonValidator
com.inductiveautomation.ignition.common.jsonschema.ItemsValidator
All Implemented Interfaces:
JsonValidator

public class ItemsValidator extends BaseJsonValidator
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 Details

  • Constructor Details

    • ItemsValidator

      public ItemsValidator(String schemaPath, com.inductiveautomation.ignition.common.gson.JsonElement schemaNode, JsonSchema parentSchema)
  • Method Details

    • findSchemaForIndex

      public Optional<JsonSchema> findSchemaForIndex(int index)
    • getSchemas

      public List<JsonSchema> 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: JsonValidator
      Validate the given JsonElement, the given node is the child node of the root node at given data path.
      Parameters:
      node - JsonElement
      rootNode - JsonElement
      at - 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

      public Optional<com.inductiveautomation.ignition.common.gson.JsonElement> getDefaultItem()