Package com.networknt.schema.resource
Class MapResourceLoader
java.lang.Object
com.networknt.schema.resource.MapResourceLoader
- All Implemented Interfaces:
ResourceLoader
Map implementation of
ResourceLoader.-
Constructor Summary
ConstructorsConstructorDescriptionMapResourceLoader(Function<String, String> mappings) Sets the resource data by absolute IRI function.MapResourceLoader(Function<String, T> mapIriToObject, Function<T, String> mapObjectToData) Sets the resource data by using two mapping functions.MapResourceLoader(Map<String, String> mappings) Sets the resource data by absolute IRI. -
Method Summary
Modifier and TypeMethodDescriptiongetResource(AbsoluteIri absoluteIri) Loads data given the retrieval IRI.
-
Constructor Details
-
MapResourceLoader
Sets the resource data by absolute IRI.- Parameters:
mappings- the mappings
-
MapResourceLoader
Sets the resource data by absolute IRI function.- Parameters:
mappings- the mappings
-
MapResourceLoader
Sets the resource 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 resource data.
- Type Parameters:
T- the type of the object- Parameters:
mapIriToObject- the mapping of IRI to objectmapObjectToData- the mappingof object to resource data
-
-
Method Details
-
getResource
Description copied from interface:ResourceLoaderLoads data given the retrieval IRI.- Specified by:
getResourcein interfaceResourceLoader- Parameters:
absoluteIri- the retrieval IRI- Returns:
- the input stream source
-