Package com.networknt.schema.resource
Class AllowSchemaLoader
- java.lang.Object
-
- com.networknt.schema.resource.AllowSchemaLoader
-
- All Implemented Interfaces:
SchemaLoader
public class AllowSchemaLoader extends java.lang.Object implements SchemaLoader
SchemaLoader
that allows loading external resources.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Predicate<AbsoluteIri>
allowed
-
Constructor Summary
Constructors Constructor Description AllowSchemaLoader(java.util.function.Predicate<AbsoluteIri> allowed)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamSource
getSchema(AbsoluteIri absoluteIri)
Loads a schema given the retrieval IRI.
-
-
-
Field Detail
-
allowed
private final java.util.function.Predicate<AbsoluteIri> allowed
-
-
Constructor Detail
-
AllowSchemaLoader
public AllowSchemaLoader(java.util.function.Predicate<AbsoluteIri> allowed)
Constructor.- Parameters:
allowed
- the predicate to determine which external resource is allowed to be loaded
-
-
Method Detail
-
getSchema
public InputStreamSource getSchema(AbsoluteIri absoluteIri)
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
-
-