Class Scope
- java.lang.Object
-
- io.openapiprocessor.jsonschema.schema.Scope
-
public class Scope extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Scope(java.net.URI documentUri, @Nullable java.net.URI id, SchemaVersion version)Scope(java.net.URI documentUri, SchemaVersion version)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScopecreateScope(java.net.URI documentUri)static ScopecreateScope(java.net.URI documentUri, java.lang.Object document, SchemaVersion fallback)create the scope for thedocument.static ScopecreateScope(java.net.URI documentUri, java.lang.Object document, Scope currentScope)create the scope for thedocument.static Scopeempty()java.net.URIgetBaseUri()java.net.URIgetDocumentUri()SchemaVersiongetVersion()Scopemove(java.lang.Object document)Scopemove(java.net.URI documentUri, java.lang.Object document)Scoperesolve(java.lang.String id)Scoperesolve(java.net.URI id)java.net.URIresolveAnchor(java.lang.String anchor)java.lang.StringtoString()
-
-
-
Constructor Detail
-
Scope
public Scope(java.net.URI documentUri, SchemaVersion version)
-
Scope
public Scope(java.net.URI documentUri, @Nullable java.net.URI id, SchemaVersion version)
-
-
Method Detail
-
empty
public static Scope empty()
-
createScope
public static Scope createScope(java.net.URI documentUri, java.lang.Object document, SchemaVersion fallback)
create the scope for thedocument. Ifdocumentcontains an id, it is the base uri, otherwise the scope is thedocumentUri. If thedocumentUrimatches a know json schema the result scope will use its version, otherwise it will use thefallbackversion.- Parameters:
documentUri- uri of the documentdocument- source documentfallback- fallback json schema version- Returns:
- the scope of the document
-
createScope
public static Scope createScope(java.net.URI documentUri, java.lang.Object document, Scope currentScope)
create the scope for thedocument. Ifdocumentcontains an id, it is the base uri, otherwise the scope is thedocumentUri. If thedocumentUrimatches a know json schema the result scope will use its version, otherwise it will use thefallbackversion.- Parameters:
documentUri- uri of the documentdocument- source documentcurrentScope- the current scope- Returns:
- the scope of the document
-
createScope
public static Scope createScope(java.net.URI documentUri)
-
getDocumentUri
public java.net.URI getDocumentUri()
-
getBaseUri
public java.net.URI getBaseUri()
-
getVersion
public SchemaVersion getVersion()
-
resolve
public Scope resolve(java.lang.String id)
-
resolve
public Scope resolve(java.net.URI id)
-
resolveAnchor
public java.net.URI resolveAnchor(java.lang.String anchor)
-
move
public Scope move(java.net.URI documentUri, java.lang.Object document)
-
move
public Scope move(java.lang.Object document)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-