Class EmailValidator

    • Constructor Detail

      • EmailValidator

        public EmailValidator​(String schemaPath,
                              com.fasterxml.jackson.databind.JsonNode schemaNode,
                              JsonSchema parentSchema,
                              ValidationContext validationContext,
                              String formatName)
    • Method Detail

      • isValid

        public boolean isValid​(String email)

        Checks if a field has a valid e-mail address.

        Parameters:
        email - The value validation is being performed on. A null value is considered invalid.
        Returns:
        true if the email address is valid.
      • isValidDomain

        protected boolean isValidDomain​(String domain)
        Returns true if the domain component of an email address is valid.
        Parameters:
        domain - being validated, may be in IDN format
        Returns:
        true if the email address's domain is valid.
      • isValidUser

        protected boolean isValidUser​(String user)
        Returns true if the user component of an email address is valid.
        Parameters:
        user - being validated
        Returns:
        true if the user name is valid.
      • validate

        public Set<ValidationMessage> validate​(com.fasterxml.jackson.databind.JsonNode node,
                                               com.fasterxml.jackson.databind.JsonNode rootNode,
                                               String at)
        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:
        node - JsonNode
        rootNode - JsonNode
        at - String
        Returns:
        A list of ValidationMessage if there is any validation error, or an empty list if there is no error.