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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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.java.net.URIgetBaseUri()java.net.URIgetDocumentUri()java.net.URIgetId()Deprecated.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, @Nullable java.net.URI id, SchemaVersion version)
-
-
Method Detail
-
getDocumentUri
public java.net.URI getDocumentUri()
-
getId
@Deprecated public java.net.URI getId()
Deprecated.
-
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)
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-