Class JsonMetaSchema

java.lang.Object
com.networknt.schema.JsonMetaSchema

public class JsonMetaSchema extends Object
Represents a meta-schema which is uniquely identified by its IRI.
  • Method Details

    • getV4

      public static JsonMetaSchema getV4()
    • getV6

      public static JsonMetaSchema getV6()
    • getV7

      public static JsonMetaSchema getV7()
    • getV201909

      public static JsonMetaSchema getV201909()
    • getV202012

      public static JsonMetaSchema getV202012()
    • builder

      public static JsonMetaSchema.Builder builder(String iri)
      Create a builder without keywords or formats.

      Use getV4() for the Draft 4 Metaschema, or if you need a builder based on Draft4, use JsonMetaSchema.builder("http://your-metaschema-iri", JsonMetaSchema.getV4()).build();

      Parameters:
      iri - the IRI of the metaschema that will be defined via this builder.
      Returns:
      a builder instance without any keywords or formats - usually not what one needs.
    • builder

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

      public static JsonMetaSchema.Builder builder(JsonMetaSchema blueprint)
      Create a builder.
      Parameters:
      blueprint - the JsonMetaSchema to base your custom JsonMetaSchema 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)
    • getIri

      public String getIri()
    • getKeywords

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

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

      public SpecVersion.VersionFlag getSpecification()
    • newValidator

      public JsonValidator newValidator(ValidationContext validationContext, SchemaLocation schemaLocation, JsonNodePath evaluationPath, String keyword, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema)
      Creates a new validator of the keyword.
      Parameters:
      validationContext - the validation context
      schemaLocation - the schema location
      evaluationPath - the evaluation path
      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