DependsOn class
A Jetleaf annotation that declares explicit dependencies between pods.
By default, Jetleaf resolves dependencies automatically based on
injection points. Use @DependsOn
when you need to enforce
initialization order or guarantee that certain infrastructure pods
are created before the annotated pod.
Key Features:
- Ensures initialization order in complex graphs.
- Can declare multiple dependencies.
- Works on both classes and methods.
Example:
@Component()
@DependsOn(["emailNotifier", "databaseService"])
class ApplicationService {
// This service will be initialized after DatabaseService and CacheService
}
Method-level Example:
class Config {
@Pod()
@DependsOn(["connectionPool"])
DatabaseClient databaseClient() => DatabaseClient();
}
- Annotations
-
- @Target.new({TargetKind.classType, TargetKind.method})
Constructors
Properties
- annotationType → Type
-
Returns the annotation _type of this annotation.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ List<
String> -
The list of String pods that must be created first.
final
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode
, andtoString
. -
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.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited