Package com.networknt.schema
Class SchemaRegistry.Builder
java.lang.Object
com.networknt.schema.SchemaRegistry.Builder
- Enclosing class:
SchemaRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()defaultDialectId(String defaultDialectId) dialectRegistry(DialectRegistry dialectRegistry) nodeReader(NodeReader nodeReader) Sets the json node reader to read the data.nodeReader(Consumer<DefaultNodeReader.Builder> customizer) Sets the json node reader to read the data.resourceLoaders(Consumer<ResourceLoaders.Builder> customizer) schemaCacheEnabled(boolean schemaCacheEnabled) schemaIdResolvers(Consumer<SchemaIdResolvers.Builder> customizer) schemaLoader(SchemaLoader schemaLoader) schemaLoader(Consumer<SchemaLoader.Builder> customizer) schemaRegistryConfig(SchemaRegistryConfig schemaRegistryConfig) Sets the schema data by absolute IRI function.Sets the schema data by using two mapping functions.Sets the schema data by absolute IRI.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
nodeReader
Sets the json node reader to read the data.A location aware object reader can be created using NodeReader.builder().locationAware().build().
- Parameters:
nodeReader- the object reader- Returns:
- the builder
-
nodeReader
Sets the json node reader to read the data.A location aware object reader can be created using schemaRegistryBuilder.nodeReader(nodeReader -> nodeReader.locationAware()).
A json ObjectMapper can be set usingschemaRegistryBuilder.nodeReader(nodeReader -> nodeReader.jsonMapper(objectMapper))
- Parameters:
customizer-- Returns:
- the builder
-
defaultDialectId
-
dialectRegistry
-
schemaCacheEnabled
-
schemaLoader
-
schemaLoader
-
resourceLoaders
-
schemaIdResolvers
-
schemaRegistryConfig
-
schemas
Sets the schema data by absolute IRI.- Parameters:
schemas- the map of IRI to schema data- Returns:
- the builder
-
schemas
Sets the schema data by absolute IRI function.- Parameters:
schemas- the function that returns schema data given IRI- Returns:
- the builder
-
schemas
public <T> SchemaRegistry.Builder schemas(Function<String, T> mapIriToObject, Function<T, String> mapObjectToData) Sets the schema data by using two mapping functions.Firstly to map the IRI to an object. If the object is null no mapping is performed.
Next to map the object to the schema data.
- Type Parameters:
T- the type of the object- Parameters:
mapIriToObject- the mapping of IRI to objectmapObjectToData- the mappingof object to schema data- Returns:
- the builder
-
build
-