Class AbstractSchemaValidator

    • Field Detail

      • resourceNodeType

        protected final Class resourceNodeType
    • Constructor Detail

      • AbstractSchemaValidator

        public AbstractSchemaValidator​(Class resourceNodeType)
    • Method Detail

      • validateAttribute

        protected abstract Optional<com.fasterxml.jackson.databind.JsonNode> validateAttribute​(SchemaAttribute schemaAttribute,
                                                                                               com.fasterxml.jackson.databind.JsonNode attribute)
        the concrete attribute validation that is differs by the context in which the attribute is validated
        Parameters:
        schemaAttribute - the definition of the attribute that must be validated
        attribute - the attribute to validate
        Returns:
        the validated attribute
      • validateDocument

        public ScimObjectNode validateDocument​(Schema schema,
                                               com.fasterxml.jackson.databind.JsonNode resource)
        checks the given document against the schema definition of the #resourceType
        Parameters:
        resource - the document that should be validated
        Returns:
        the validated resource
      • checkDocumentAndMetaSchemaRelationship

        protected com.fasterxml.jackson.databind.JsonNode checkDocumentAndMetaSchemaRelationship​(Schema resourceSchema,
                                                                                                 com.fasterxml.jackson.databind.JsonNode document)
        this method will verify that the meta schema is the correct schema to validate the document. This is done by comparing the "id"-attribute of the metaSchema with the "schemas"-attribute of the document
        Parameters:
        resourceSchema - the resources schema that should be used to validate the document
        document - the document that should be validated
      • validateDocument

        protected ScimObjectNode validateDocument​(ScimObjectNode validatedResource,
                                                  Schema resourceSchema,
                                                  com.fasterxml.jackson.databind.JsonNode resource)
        this method will validates either a resource document or an extension document that is part of the resource document. Extensions are handled as individual schemas.
        Parameters:
        validatedResource - The object into which the validated attributes will be added. In case of main document validation this object will be of type ResourceNode and in case of extension validation of type ScimObjectNode
        resourceSchema - the definition of the document that is either the main schema of the #resourceType of an extension that is present within the current document
        resource - the document that should be validated
        Returns:
        the validated document with its scim attribute representations