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 ofSchemaIdValidator.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 Constructor Description DefaultSchemaIdValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanhasNoContext(SchemaLocation schemaLocation)protected booleanisAbsoluteIri(String iri)protected booleanisFragment(String id)protected booleanstartsWithSlash(String id)booleanvalidate(String id, boolean rootSchema, SchemaLocation schemaLocation, SchemaLocation resolvedSchemaLocation, SchemaContext schemaContext)Validates if the $id value is valid.
-
-
-
Method Detail
-
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
protected boolean startsWithSlash(String id)
-
isFragment
protected boolean isFragment(String id)
-
hasNoContext
protected boolean hasNoContext(SchemaLocation schemaLocation)
-
isAbsoluteIri
protected boolean isAbsoluteIri(String iri)
-
-