Package com.networknt.schema
Class SchemaLocation
java.lang.Object
com.networknt.schema.SchemaLocation
The schema location is the canonical IRI of the schema object plus a JSON
Pointer fragment indicating the subschema that produced a result. In contrast
with the evaluation path, the schema location MUST NOT include by-reference
applicators such as $ref or $dynamicRef.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for buildingSchemaLocation.static classThe fragment can be a JSON pointer to the document or an anchor. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SchemaLocationRepresents a relative schema location to the current document. -
Constructor Summary
ConstructorsConstructorDescriptionSchemaLocation(AbsoluteIri absoluteIri) Constructs a newSchemaLocation.SchemaLocation(AbsoluteIri absoluteIri, NodePath fragment) Constructs a newSchemaLocation. -
Method Summary
Modifier and TypeMethodDescriptionappend(int index) Appends the index to the fragment.Appends the token to the fragment.static SchemaLocation.Builderbuilder()Returns a builder for buildingSchemaLocation.booleanGets the canonical absolute IRI of the schema object.Gets the fragment.inthashCode()static SchemaLocationParses a string representing an IRI of the schema location.static Stringresolve(SchemaLocation schemaLocation, String absoluteIriReferenceOrFragment) Resolves against a absolute IRI reference or fragment.Resolves against a absolute IRI reference or fragment.toString()
-
Field Details
-
DOCUMENT
Represents a relative schema location to the current document.
-
-
Constructor Details
-
SchemaLocation
Constructs a newSchemaLocation.- Parameters:
absoluteIri- canonical absolute IRI of the schema objectfragment- the fragment
-
SchemaLocation
Constructs a newSchemaLocation.- Parameters:
absoluteIri- canonical absolute IRI of the schema object
-
-
Method Details
-
getAbsoluteIri
Gets the canonical absolute IRI of the schema object.This is a unique identifier indicated by the $id property or id property in Draft 4 and earlier. This does not have to be network accessible.
- Returns:
- the canonical absolute IRI of the schema object.
-
getFragment
Gets the fragment.- Returns:
- the fragment
-
append
Appends the token to the fragment.- Parameters:
token- the segment- Returns:
- a new schema location with the segment
-
append
Appends the index to the fragment.- Parameters:
index- the segment- Returns:
- a new schema location with the segment
-
of
Parses a string representing an IRI of the schema location.- Parameters:
iri- the IRI- Returns:
- the schema location
-
resolve
Resolves against a absolute IRI reference or fragment.- Parameters:
absoluteIriReferenceOrFragment- to resolve- Returns:
- the resolved schema location
-
resolve
Resolves against a absolute IRI reference or fragment.- Parameters:
schemaLocation- the parentabsoluteIriReferenceOrFragment- to resolve- Returns:
- the resolved schema location
-
builder
Returns a builder for buildingSchemaLocation.- Returns:
- the builder
-
toString
-
hashCode
public int hashCode() -
equals
-