class SchemaDefinitionResolver extends AnyRef

Centralized, lazily-populated cache for resolving JSON Schema definitions.

When AMF parses a JsonLDInstanceDocument it annotates each object with a SourceSchemaDef linking it to its schema definition. However, AMF often cannot disambiguate behind oneOf/anyOf, leaving many objects without this annotation.

This resolver provides two resolution strategies sharing a single object-level cache:

  • Branch-guided (resolve(element, stack, astPartBranch)): Navigates the schema tree following the AST branch and caches each object's definition as it drills through the schema tree following the AST branch. Use this from completions and hover where cursor position matters.
  • Stack-based (resolve(element, stack)): Walks the ancestor stack using object field / ID matching and caches intermediates. Use this from visitors and other position-independent consumers.

Because both paths write to the same cache, a branch-guided resolution of [current, a, b, c, d, root] will cache definitions for every intermediate object, so a subsequent query for [sub-current, current, …] resolves in O(1) from current.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SchemaDefinitionResolver
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SchemaDefinitionResolver(rootDefinition: Shape)

    rootDefinition

    the root schema definition shape (typically from the JsonSchemaDocument's encodes)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  14. def resolve(element: AmfElement, stack: Seq[AmfElement], astPartBranch: ASTPartBranch): GuessedShapeResult

    Resolves schema definitions for element using the AST branch to navigate to the most specific field-level definition.

    Resolves schema definitions for element using the AST branch to navigate to the most specific field-level definition. Caches every intermediate object encountered during traversal.

    Finds the nearest object with a known definition (annotated via sourceSchemaDef or cached) and navigates from there following the AST branch. When starting from a sourceSchemaDef object, candidates start empty (the traversal populates them as it drills deeper). When starting from a cache-only object, the cached definitions are passed as candidates so the leaf case (findMatches) still has shapes to work with.

  15. def resolveField(element: AmfElement, stack: Seq[AmfElement], fieldName: String): GuessedShapeResult

    Resolves schema definitions for a specific field within element by name.

    Resolves schema definitions for a specific field within element by name. Walks the ancestor stack to find a known starting point, then navigates down through intermediates using unfiltered variant expansion (allOf/anyOf/oneOf all explored). This ensures all possible definitions are found regardless of discriminator values at intermediate levels.

  16. def resolveSemanticTypeIris(element: AmfElement, stack: Seq[AmfElement]): Seq[String]

    Extracts semantic @type IRIs from the resolved definitions.

  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped