Package com.networknt.schema
Class JsonSchemaIdValidator.DefaultJsonSchemaIdValidator
java.lang.Object
com.networknt.schema.JsonSchemaIdValidator.DefaultJsonSchemaIdValidator
- All Implemented Interfaces:
JsonSchemaIdValidator
- Enclosing interface:
JsonSchemaIdValidator
public static class JsonSchemaIdValidator.DefaultJsonSchemaIdValidator
extends Object
implements JsonSchemaIdValidator
Implementation of
JsonSchemaIdValidator.
Note that this does not strictly follow the specification.
This allows an $id that isn't an absolute-IRI on the root schema, but it must resolve to an absolute-IRI given a base-IRI.
This also allows non-empty fragments.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.networknt.schema.JsonSchemaIdValidator
JsonSchemaIdValidator.DefaultJsonSchemaIdValidator -
Field Summary
Fields inherited from interface com.networknt.schema.JsonSchemaIdValidator
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanhasNoContext(SchemaLocation schemaLocation) protected booleanisAbsoluteIri(String iri) protected booleanisFragment(String id) protected booleanbooleanvalidate(String id, boolean rootSchema, SchemaLocation schemaLocation, SchemaLocation resolvedSchemaLocation, ValidationContext validationContext) Validates if the $id value is valid.
-
Constructor Details
-
DefaultJsonSchemaIdValidator
public DefaultJsonSchemaIdValidator()
-
-
Method Details
-
validate
public boolean validate(String id, boolean rootSchema, SchemaLocation schemaLocation, SchemaLocation resolvedSchemaLocation, ValidationContext validationContext) Description copied from interface:JsonSchemaIdValidatorValidates if the $id value is valid.- Specified by:
validatein interfaceJsonSchemaIdValidator- Parameters:
id- the $id or idrootSchema- true if this is a root schemaschemaLocation- the schema locationresolvedSchemaLocation- the schema location after resolving with the idvalidationContext- the validation context for instance to get the meta schema- Returns:
- true if valid
-
startsWithSlash
-
isFragment
-
hasNoContext
-
isAbsoluteIri
-