Class Context


  • public class Context
    extends java.lang.Object
    the 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 different Context objects. 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.JsonInstanceContext getInstanceContext()  
      @Nullable java.net.URI getRef​(io.openapiprocessor.jsonschema.schema.Bucket bucket)  
      io.openapiprocessor.jsonschema.schema.Reference getReference​(io.openapiprocessor.jsonschema.schema.Bucket bucket)  
      @Nullable io.openapiprocessor.jsonschema.schema.Bucket getRefObjectOrNull​(io.openapiprocessor.jsonschema.schema.Bucket bucket)  
      io.openapiprocessor.jsonschema.schema.Bucket getRefObjectOrThrow​(io.openapiprocessor.jsonschema.schema.Bucket bucket)  
      Context withScope​(io.openapiprocessor.jsonschema.schema.Scope targetScope)
      get a context with the given scope.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Context

        public Context​(io.openapiprocessor.jsonschema.schema.Scope scope,
                       io.openapiprocessor.jsonschema.schema.ReferenceRegistry references)
    • 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