Class Dialect

java.lang.Object
com.networknt.schema.dialect.Dialect

public class Dialect extends Object
A dialect represents the set of keywords and semantics that can be used to evaluate a schema. The dialect can be uniquely identified by its IRI which points to the meta-schema used to validate schemas written for that dialect. The dialect for a particular schema is indicated using the $schema keyword.
  • Method Details

    • builder

      public static Dialect.Builder builder(String id)
      Create a builder without keywords or formats.
      Parameters:
      id - the IRI of the dialect that will be defined via this builder.
      Returns:
      a builder instance without any keywords or formats - usually not what one needs.
    • builder

      public static Dialect.Builder builder(String id, Dialect blueprint)
      Create a builder.
      Parameters:
      id - the IRI of your new Dialect that will be defined via this builder.
      blueprint - the Dialect to base your custom Dialect on.
      Returns:
      a builder instance preconfigured to be the same as blueprint, but with a different uri.
    • builder

      public static Dialect.Builder builder(Dialect blueprint)
      Create a builder.
      Parameters:
      blueprint - the Dialect to base your custom Dialect on.
      Returns:
      a builder instance preconfigured to be the same as blueprint
    • getIdKeyword

      public String getIdKeyword()
    • readId

      public String readId(com.fasterxml.jackson.databind.JsonNode schemaNode)
    • readAnchor

      public String readAnchor(com.fasterxml.jackson.databind.JsonNode schemaNode)
    • readDynamicAnchor

      public String readDynamicAnchor(com.fasterxml.jackson.databind.JsonNode schemaNode)
    • getId

      public String getId()
    • getKeywords

      public Map<String,Keyword> getKeywords()
    • getVocabularies

      public Map<String,Boolean> getVocabularies()
    • getSpecificationVersion

      public SpecificationVersion getSpecificationVersion()
    • newValidator

      public KeywordValidator newValidator(SchemaContext schemaContext, SchemaLocation schemaLocation, String keyword, com.fasterxml.jackson.databind.JsonNode schemaNode, Schema parentSchema)
      Creates a new validator of the keyword.
      Parameters:
      schemaContext - the schema context
      schemaLocation - the schema location
      keyword - the keyword
      schemaNode - the schema node
      parentSchema - the parent schema
      Returns:
      the validator
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object