Class EnumValidator

All Implemented Interfaces:
KeywordValidator, Validator, Walker

public class EnumValidator extends BaseKeywordValidator implements KeywordValidator
  • Constructor Details

    • EnumValidator

      public EnumValidator(SchemaLocation schemaLocation, com.fasterxml.jackson.databind.JsonNode schemaNode, Schema parentSchema, SchemaContext schemaContext)
  • Method Details

    • validate

      public void validate(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, NodePath instanceLocation)
      Description copied from interface: Validator
      Validate the instance node which belongs to the instance document at the instance location.
      Specified by:
      validate in interface Validator
      Parameters:
      executionContext - the execution context
      node - the instance node being processed
      rootNode - the instance document that the instance node belongs to
      instanceLocation - the location of the instance node being processed
    • processNumberNode

      protected com.fasterxml.jackson.databind.JsonNode processNumberNode(com.fasterxml.jackson.databind.JsonNode n)
      Processes the number and ensures trailing zeros are stripped.
      Parameters:
      n - the node
      Returns:
      the node
    • processArrayNode

      protected com.fasterxml.jackson.databind.node.ArrayNode processArrayNode(com.fasterxml.jackson.databind.node.ArrayNode node)
      Processes the array and ensures that numbers within have trailing zeroes stripped.
      Parameters:
      node - the node
      Returns:
      the node
    • hasNumber

      protected boolean hasNumber(com.fasterxml.jackson.databind.node.ArrayNode node)
      Determines if the array node contains a number.
      Parameters:
      node - the node
      Returns:
      the node