Class MapResourceLoader

java.lang.Object
com.networknt.schema.resource.MapResourceLoader
All Implemented Interfaces:
ResourceLoader

public class MapResourceLoader extends Object implements ResourceLoader
Map implementation of ResourceLoader.
  • Constructor Details

    • MapResourceLoader

      public MapResourceLoader(Map<String,String> mappings)
      Sets the resource data by absolute IRI.
      Parameters:
      mappings - the mappings
    • MapResourceLoader

      public MapResourceLoader(Function<String,String> mappings)
      Sets the resource data by absolute IRI function.
      Parameters:
      mappings - the mappings
    • MapResourceLoader

      public MapResourceLoader(Function<String,T> mapIriToObject, Function<T,String> mapObjectToData)
      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 object
      mapObjectToData - the mappingof object to resource data
  • Method Details