Package com.networknt.schema
Class SchemaIdValidator.DefaultSchemaIdValidator
java.lang.Object
com.networknt.schema.SchemaIdValidator.DefaultSchemaIdValidator
- All Implemented Interfaces:
SchemaIdValidator
- Enclosing interface:
SchemaIdValidator
public static class SchemaIdValidator.DefaultSchemaIdValidator
extends Object
implements SchemaIdValidator
Implementation of
SchemaIdValidator.
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.SchemaIdValidator
SchemaIdValidator.DefaultSchemaIdValidator -
Field Summary
Fields inherited from interface com.networknt.schema.SchemaIdValidator
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, SchemaContext schemaContext) Validates if the $id value is valid.
-
Constructor Details
-
DefaultSchemaIdValidator
public DefaultSchemaIdValidator()
-
-
Method Details
-
validate
public boolean validate(String id, boolean rootSchema, SchemaLocation schemaLocation, SchemaLocation resolvedSchemaLocation, SchemaContext schemaContext) Description copied from interface:SchemaIdValidatorValidates if the $id value is valid.- Specified by:
validatein interfaceSchemaIdValidator- Parameters:
id- the $id or idrootSchema- true if this is a root schemaschemaLocation- the schema locationresolvedSchemaLocation- the schema location after resolving with the idschemaContext- the schema context for instance to get the meta schema- Returns:
- true if valid
-
startsWithSlash
-
isFragment
-
hasNoContext
-
isAbsoluteIri
-