Package io.openapiparser
Class Context
- java.lang.Object
-
- io.openapiparser.Context
-
public class Context extends java.lang.Objectthe context is used to resolve $ref's. All model objects have a context. Objects from the same source file will re-use the same context. Objects from different source files will have differentContextobjects. If a $ref links to another source file the "current" context will create a new context with the new source file.
-
-
Constructor Summary
Constructors Constructor Description Context(io.openapiprocessor.jsonschema.schema.Scope scope, io.openapiprocessor.jsonschema.schema.ReferenceRegistry references)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.openapiprocessor.jsonschema.schema.JsonInstanceContextgetInstanceContext()@Nullable java.net.URIgetRef(io.openapiprocessor.jsonschema.schema.Bucket bucket)io.openapiprocessor.jsonschema.schema.ReferencegetReference(io.openapiprocessor.jsonschema.schema.Bucket bucket)@Nullable io.openapiprocessor.jsonschema.schema.BucketgetRefObjectOrNull(io.openapiprocessor.jsonschema.schema.Bucket bucket)io.openapiprocessor.jsonschema.schema.BucketgetRefObjectOrThrow(io.openapiprocessor.jsonschema.schema.Bucket bucket)ContextwithScope(io.openapiprocessor.jsonschema.schema.Scope targetScope)get a context with the given scope.
-
-
-
Method Detail
-
getRefObjectOrThrow
public io.openapiprocessor.jsonschema.schema.Bucket getRefObjectOrThrow(io.openapiprocessor.jsonschema.schema.Bucket bucket)
-
getRefObjectOrNull
public @Nullable io.openapiprocessor.jsonschema.schema.Bucket getRefObjectOrNull(io.openapiprocessor.jsonschema.schema.Bucket bucket)
-
getRef
public @Nullable java.net.URI getRef(io.openapiprocessor.jsonschema.schema.Bucket bucket)
-
getReference
public io.openapiprocessor.jsonschema.schema.Reference getReference(io.openapiprocessor.jsonschema.schema.Bucket bucket)
-
getInstanceContext
public io.openapiprocessor.jsonschema.schema.JsonInstanceContext getInstanceContext()
-
withScope
public Context withScope(io.openapiprocessor.jsonschema.schema.Scope targetScope)
get a context with the given scope. If this context has the same scope it will return itself otherwise it will create a new context with the given scope.- Parameters:
targetScope- the new scope uri.- Returns:
- context with the scope uri
-
-