Class EnumValidator

    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • nodes

        private final java.util.Set<com.fasterxml.jackson.databind.JsonNode> nodes
      • error

        private final java.lang.String error
    • Method Detail

      • asText

        static java.lang.String asText​(com.fasterxml.jackson.databind.JsonNode node)
      • validate

        public java.util.Set<ValidationMessage> validate​(ExecutionContext executionContext,
                                                         com.fasterxml.jackson.databind.JsonNode node,
                                                         com.fasterxml.jackson.databind.JsonNode rootNode,
                                                         JsonNodePath instanceLocation)
        Description copied from interface: JsonValidator
        Validate the given JsonNode, the given node is the child node of the root node at given data path.
        Specified by:
        validate in interface JsonValidator
        Parameters:
        executionContext - ExecutionContext
        node - JsonNode
        rootNode - JsonNode
        instanceLocation - JsonNodePath
        Returns:
        A list of ValidationMessage if there is any validation error, or an empty list if there is no error.
      • isTypeLooseContainsInEnum

        private boolean isTypeLooseContainsInEnum​(com.fasterxml.jackson.databind.JsonNode node)
        Check whether enum contains the value of the JsonNode if the typeLoose is enabled.
        Parameters:
        node - JsonNode to check
      • 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