Class SchemaDocument

    • 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