Package com.networknt.schema.dialect
Class Dialect.Builder
- java.lang.Object
-
- com.networknt.schema.dialect.Dialect.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dialectbuild()Dialect.Builderformat(Format format)Adds the format.Dialect.BuilderformatKeywordFactory(Dialect.FormatKeywordFactory formatKeywordFactory)Sets the format keyword factory.Dialect.Builderformats(Collection<? extends Format> formats)Adds the formats.Dialect.Builderformats(Consumer<Map<String,Format>> customizer)Customize the formats.Dialect.BuilderidKeyword(String idKeyword)Sets the id keyword.Dialect.Builderkeyword(Keyword keyword)Adds the keyword.Dialect.Builderkeywords(Collection<? extends Keyword> keywords)Adds the keywords.Dialect.Builderkeywords(Consumer<Map<String,Keyword>> customizer)Customize the keywords.Dialect.BuilderspecificationVersion(SpecificationVersion specification)Sets the specification version.Dialect.BuilderunknownKeywordFactory(KeywordFactory unknownKeywordFactory)Sets the keyword factory for handling unknown keywords.Dialect.Buildervocabularies(Consumer<Map<String,Boolean>> customizer)Customize the vocabularies.Dialect.Buildervocabularies(Map<String,Boolean> vocabularies)Adds the vocabularies.Dialect.Buildervocabulary(String vocabulary)Adds a required vocabulary.Dialect.Buildervocabulary(String vocabulary, boolean required)Adds a vocabulary.Dialect.BuildervocabularyRegistry(VocabularyRegistry vocabularyRegistry)Sets the vocabulary registry for handling custom vocabularies.
-
-
-
Constructor Detail
-
Builder
public Builder(String id)
-
-
Method Detail
-
formatKeywordFactory
public Dialect.Builder formatKeywordFactory(Dialect.FormatKeywordFactory formatKeywordFactory)
Sets the format keyword factory.- Parameters:
formatKeywordFactory- the format keyword factory- Returns:
- the builder
-
vocabularyRegistry
public Dialect.Builder vocabularyRegistry(VocabularyRegistry vocabularyRegistry)
Sets the vocabulary registry for handling custom vocabularies.- Parameters:
vocabularyRegistry- the registry- Returns:
- the builder
-
unknownKeywordFactory
public Dialect.Builder unknownKeywordFactory(KeywordFactory unknownKeywordFactory)
Sets the keyword factory for handling unknown keywords.- Parameters:
unknownKeywordFactory- the factory- Returns:
- the builder
-
formats
public Dialect.Builder formats(Consumer<Map<String,Format>> customizer)
Customize the formats.- Parameters:
customizer- the customizer- Returns:
- the builder
-
keywords
public Dialect.Builder keywords(Consumer<Map<String,Keyword>> customizer)
Customize the keywords.- Parameters:
customizer- the customizer- Returns:
- the builder
-
keyword
public Dialect.Builder keyword(Keyword keyword)
Adds the keyword.- Parameters:
keyword- the keyword- Returns:
- the builder
-
keywords
public Dialect.Builder keywords(Collection<? extends Keyword> keywords)
Adds the keywords.- Parameters:
keywords- the keywords- Returns:
- the builder
-
format
public Dialect.Builder format(Format format)
Adds the format.- Parameters:
format- the format- Returns:
- the builder
-
formats
public Dialect.Builder formats(Collection<? extends Format> formats)
Adds the formats.- Parameters:
formats- the formats- Returns:
- the builder
-
vocabulary
public Dialect.Builder vocabulary(String vocabulary)
Adds a required vocabulary.Note that an error will be raised if this vocabulary is unknown.
- Parameters:
vocabulary- the vocabulary IRI- Returns:
- the builder
-
vocabulary
public Dialect.Builder vocabulary(String vocabulary, boolean required)
Adds a vocabulary.- Parameters:
vocabulary- the vocabulary IRIrequired- true indicates if the vocabulary is not recognized processing should stop- Returns:
- the builder
-
vocabularies
public Dialect.Builder vocabularies(Map<String,Boolean> vocabularies)
Adds the vocabularies.- Parameters:
vocabularies- the vocabularies to add- Returns:
- the builder
-
vocabularies
public Dialect.Builder vocabularies(Consumer<Map<String,Boolean>> customizer)
Customize the vocabularies.- Parameters:
customizer- the customizer- Returns:
- the builder
-
specificationVersion
public Dialect.Builder specificationVersion(SpecificationVersion specification)
Sets the specification version.- Parameters:
specification- the specification version- Returns:
- the builder
-
idKeyword
public Dialect.Builder idKeyword(String idKeyword)
Sets the id keyword.- Parameters:
idKeyword- the id keyword- Returns:
- the builder
-
build
public Dialect build()
-
-