Package com.networknt.schema.resource
Class MapSchemaLoader
java.lang.Object
com.networknt.schema.resource.MapSchemaLoader
- All Implemented Interfaces:
SchemaLoader
Map implementation of
SchemaLoader
.-
Constructor Summary
ConstructorsConstructorDescriptionMapSchemaLoader
(Function<String, String> mappings) Sets the schema data by absolute IRI function.MapSchemaLoader
(Function<String, T> mapIriToObject, Function<T, String> mapObjectToData) Sets the schema data by using two mapping functions.MapSchemaLoader
(Map<String, String> mappings) Sets the schema data by absolute IRI. -
Method Summary
Modifier and TypeMethodDescriptiongetSchema
(AbsoluteIri absoluteIri) Loads a schema given the retrieval IRI.
-
Constructor Details
-
MapSchemaLoader
Sets the schema data by absolute IRI.- Parameters:
mappings
- the mappings
-
MapSchemaLoader
Sets the schema data by absolute IRI function.- Parameters:
mappings
- the mappings
-
MapSchemaLoader
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
-
-
Method Details
-
getSchema
Description copied from interface:SchemaLoader
Loads a schema given the retrieval IRI.- Specified by:
getSchema
in interfaceSchemaLoader
- Parameters:
absoluteIri
- the retrieval IRI- Returns:
- the input stream source
-