Class MapSchemaLoader

java.lang.Object
com.networknt.schema.resource.MapSchemaLoader
All Implemented Interfaces:
SchemaLoader

public class MapSchemaLoader extends Object implements SchemaLoader
Map implementation of SchemaLoader.
  • Constructor Details

    • MapSchemaLoader

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

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

      public MapSchemaLoader(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 object
      mapObjectToData - the mappingof object to schema data
  • Method Details