Class SchemaDocument

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SchemaDocument.Builder
      Builds a JSON Schema document.
    • Method Summary

      Modifier and Type Method Description
      static SchemaDocument.Builder builder()
      Returns a builder used to create a SchemaDocument.
      boolean equals​(java.lang.Object o)  
      java.util.Optional<Schema> getDefinition​(java.lang.String pointer)
      Gets a schema definition from the "definitions" map using a JSON pointer.
      java.util.Map<java.lang.String,​Schema> getDefinitions()
      Gets all of the schema definitions defined in the "definitions" map.
      java.util.Optional<Node> getExtension​(java.lang.String key)
      Gets an extension value by name.
      ObjectNode getExtensions()
      Gets all extensions of the schema document.
      java.util.Optional<java.lang.String> getIdKeyword()
      Gets the "$id" keyword of the document.
      Schema getRootSchema()
      Gets the root schema definition.
      java.util.Optional<java.lang.String> getSchemaKeyword()
      Gets the "$schema" keyword of the document.
      int hashCode()  
      SchemaDocument.Builder toBuilder()
      Take this object and create a builder that contains all of the current property values of this object.
      Node toNode()
      Converts a value to a Node.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toNode

        public Node toNode()
        Description copied from interface: ToNode
        Converts a value to a Node.
        Specified by:
        toNode in interface ToNode
        Returns:
        Returns the creates Node.
      • getRootSchema

        public Schema getRootSchema()
        Gets the root schema definition.
        Returns:
        Returns the root schema.
        See Also:
        Root schema
      • getIdKeyword

        public java.util.Optional<java.lang.String> getIdKeyword()
        Gets the "$id" keyword of the document.
        Returns:
        Returns the optionally defined $id.
        See Also:
        $id
      • getSchemaKeyword

        public java.util.Optional<java.lang.String> getSchemaKeyword()
        Gets the "$schema" keyword of the document.
        Returns:
        Returns the optionally defined $schema.
        See Also:
        $schema
      • getDefinition

        public java.util.Optional<Schema> getDefinition​(java.lang.String pointer)
        Gets a schema definition from the "definitions" map using a JSON pointer.

        The "root" schema is returned if pointer is an empty string.

        Parameters:
        pointer - JSON Schema pointer to retrieve.
        Returns:
        Returns the optionally found schema definition.
      • getDefinitions

        public java.util.Map<java.lang.String,​Schema> getDefinitions()
        Gets all of the schema definitions defined in the "definitions" map.
        Returns:
        Returns the defined schema definitions.
        See Also:
        Schema reuse with "definitions"
      • getExtension

        public java.util.Optional<Node> getExtension​(java.lang.String key)
        Gets an extension value by name.
        Parameters:
        key - Name of the extension to retrieve.
        Returns:
        Returns the extension object.
      • getExtensions

        public ObjectNode getExtensions()
        Gets all extensions of the schema document.
        Returns:
        Returns the extensions added to the schema.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object