org.mulesoft.als.common.finder.jsonschema
SchemaDefinitionResolver
Companion object SchemaDefinitionResolver
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.
- Alphabetic
- By Inheritance
- SchemaDefinitionResolver
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
SchemaDefinitionResolver(rootDefinition: Shape)
- rootDefinition
the root schema definition shape (typically from the JsonSchemaDocument's encodes)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
def
resolve(element: AmfElement, stack: Seq[AmfElement], astPartBranch: ASTPartBranch): GuessedShapeResult
Resolves schema definitions for
elementusing the AST branch to navigate to the most specific field-level definition.Resolves schema definitions for
elementusing 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
sourceSchemaDefor cached) and navigates from there following the AST branch. When starting from asourceSchemaDefobject, 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. -
def
resolveField(element: AmfElement, stack: Seq[AmfElement], fieldName: String): GuessedShapeResult
Resolves schema definitions for a specific field within
elementby name.Resolves schema definitions for a specific field within
elementby 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. -
def
resolveSemanticTypeIris(element: AmfElement, stack: Seq[AmfElement]): Seq[String]
Extracts semantic @type IRIs from the resolved definitions.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated