Package com.networknt.schema.dialect
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDialect.BuilderBuilder forDialect.static interfaceDialect.FormatKeywordFactoryFactory for creating a format keyword.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Dialect.Builderbuilder(Dialect blueprint)Create a builder.static Dialect.Builderbuilder(String id)Create a builder without keywords or formats.static Dialect.Builderbuilder(String id, Dialect blueprint)Create a builder.booleanequals(Object obj)StringgetId()StringgetIdKeyword()Map<String,Keyword>getKeywords()SpecificationVersiongetSpecificationVersion()Map<String,Boolean>getVocabularies()inthashCode()KeywordValidatornewValidator(SchemaContext schemaContext, SchemaLocation schemaLocation, String keyword, com.fasterxml.jackson.databind.JsonNode schemaNode, Schema parentSchema)Creates a new validator of the keyword.StringreadAnchor(com.fasterxml.jackson.databind.JsonNode schemaNode)StringreadDynamicAnchor(com.fasterxml.jackson.databind.JsonNode schemaNode)StringreadId(com.fasterxml.jackson.databind.JsonNode schemaNode)StringtoString()
-
-
-
Method Detail
-
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()
-
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 contextschemaLocation- the schema locationkeyword- the keywordschemaNode- the schema nodeparentSchema- the parent schema- Returns:
- the validator
-
-