JetleafEntry class final

A reflectable annotation that marks a top-level void main() as a JetLeaf application entry.

jl dev discovers every main() annotated with JetleafEntry and boots a VM for it. Production runtime semantics apply: the VM populates the runtime with runScan (skipTests: true) backed by the .jetleaf/ cache before invoking main().

Usage Requirements:

  • Only valid on top-level function declarations (TargetKind.function)
  • Only void main() functions are discovered; annotations anywhere else are ignored with a warning
  • Should specify args when the entry honors CLI arguments

{@template jetleaf_entry_example} Example usage:

import 'package:jetleaf_core/lang.dart';

@JetleafEntry()
void main(List<String> args) async {
  // Runtime already populated, args forwarded from `jl run`.
}

See also:

Inheritance
Mixed-in types
Annotations
  • @Target.new({TargetKind.function})

Constructors

JetleafEntry({List<String> args = const []})
A reflectable annotation that marks a top-level void main() as a JetLeaf application entry.
const

Properties

annotationType → Type
Returns the annotation _type of this annotation.
no setteroverride
args → List<String>
CLI args forwarded to main when the VM invokes it.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() → List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
override
equals(Object other) → bool
Checks whether the given object is logically equivalent to this annotation.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
Returns a string representation of this annotation.
override

Operators

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