RuntimeHintProvider class abstract interface

A factory interface responsible for producing concrete RuntimeHint instances.

RuntimeHintProvider represents the declarative entry point through which JetLeaf discovers and instantiates runtime hints during both:

  • AOT analysis (via build-time scanning)
  • JIT / mirror-based reflection (during runtime hint resolution)

Implementations of this interface are typically lightweight and are used to register a hint type with the JetLeaf resolution system without requiring the hint itself to expose a public constructor.

Purpose

JetLeaf’s runtime behavior is extensible through RuntimeHint implementations, which can override:

  • Instance creation
  • Method invocation
  • Field reads
  • Field writes

However, hints may require initialization logic, configuration, or dependency injection. RuntimeHintProvider abstracts how the hint instance is constructed, allowing:

  • Controlled instantiation
  • Centralized configuration
  • Injection of external services
  • Reuse of hint objects where appropriate

This isolates hint creation from the rest of the reflection system.

Typical Usage

class UserHintProvider implements RuntimeHintProvider {
  @override
  RuntimeHint createHint() => UserHint();
}

Providers are registered and discovered by the AOT resolver through JetLeaf's annotation scanning and code generation pipeline.

Integration Notes

  • The returned hint must implement RuntimeHint.
  • Providers should avoid expensive initialization during construction. Defer work to the hint instance when possible.
  • The resolver may construct providers multiple times depending on the chosen execution path (AOT or JIT).

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createHint() RuntimeHint
Creates and returns a new RuntimeHint instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited