annotation library Annotations
π· JetLeaf Core Annotations
This library provides a comprehensive set of annotations for JetLeaf applications, enabling declarative configuration of:
- Lifecycle management
- Dependency injection
- Configuration classes
- Conditional bean/pod registration
- Interception and cross-cutting concerns
- Component roles and stereotypes
Annotations simplify object management and support compile-time and runtime processing for JetLeafβs IoC and AOP capabilities.
π Core Annotation Categories
π Lifecycle Annotations
lifecycle.dartβ annotations to define initialization, destruction, or other lifecycle callbacks for pods/beans.
β‘ Dependency Injection Annotations
autowired.dartβ annotations for automatic injection of dependencies and qualifiers to resolve ambiguities.
β Configuration Annotations
configuration.dartβ annotations for marking configuration classes and defining configuration behaviors.- Excludes
CommonConfigurationto avoid conflicts with base configurations.
π± Conditional Annotations
conditional.dartβ annotations for environment-based or condition-based pod/bean registration.
π§ Utility Annotations
others.dartβ miscellaneous annotations for various purposes, such as marking optional elements or helper metadata.
π Pod and Scope Annotations
pod.dartβ annotations for defining pods, their lifecycles, scopes, and dependencies.
π Component Stereotype Annotations
stereotype.dartβ annotations to classify components by architectural role, such as service, repository, or controller.
π Interception Annotations
intercept.dartβ annotations for method-level interception and cross-cutting behavior (e.g., logging, metrics)
π― Intended Usage
Import this library to use annotations for declarative configuration and management of JetLeaf application components:
import 'package:jetleaf_core/annotation.dart';
@Service()
class UserService {
@Autowired()
late UserRepository repository;
@PostConstruct()
void init() {
// Initialization logic
}
}
Provides a foundation for IoC, dependency injection, AOP, and modular application design in JetLeaf.
Classes
- AutoConfiguration
- Declares a class as a source of automatic configuration.
- Autowired
- Autowired annotation for dependency injection
- AutowiredIgnore
- An annotation used to mark a field as ignored by the dependency injection container.
- Cleanup
- Marks a method to be invoked after a pod is destroyed.
- Component
- Component annotation for generic Jet components
- ComponentScan
- Annotation for Jetleaf component scanning.
- ComponentScanFilter
- Represents a filter definition for component scanning.
- Conditional
- An annotation that conditionally enables or disables JetLeaf-managed constructs such as Component, Pod, or configuration classes based on one or more declarative Condition evaluators.
- ConditionalOnAsset
- An annotation that conditionally activates a Component, Pod, or configuration class based on the presence of a specific asset in the application's resources.
- ConditionalOnClass
- An annotation that conditionally activates a Component, Pod, or configuration class only if specific classes are present in the Dart runtime or compilation environment.
- ConditionalOnDart
- An annotation that conditionally activates a Component, Pod, or configuration class based on the current Dart SDK version.
- ConditionalOnExpression
- An annotation that conditionally activates a Component, Pod, or configuration class based on the evaluation of a custom expression.
- ConditionalOnMissingClass
- An annotation that conditionally activates a Component, Pod, or configuration class only if certain classes are absent from the Dart runtime or compilation environment.
- ConditionalOnMissingPod
- An annotation that activates a component only when specific pods are absent from the ConditionalContext.
- ConditionalOnPod
- An annotation that conditionally activates a Component, Pod, or configuration class based on the presence of other pods within the current ConditionalContext.
- ConditionalOnProfile
- An annotation that conditionally activates a Component, Pod, or configuration class based on the currently active profiles in the ConditionalContext.
- ConditionalOnProperty
- An annotation that conditionally enables a Component, Pod, or configuration class based on the value(s) of one or more properties.
- Configuration
- Configuration annotation for configuration classes
- ConfigurationProperty
-
Annotation used to bind externalized configuration properties
from the
Environmentinto a Dart object. - DependsOn
- A Jetleaf annotation that declares explicit dependencies between pods.
- Description
- Provides a human-readable description of a class or method.
- EventListener
- Annotation to mark a method that should run when the application is listening to a specific type of ApplicationEvent.
-
EventType<
T extends ApplicationEvent> - π« Represents a typed application event associated with a specific package.
- Import
-
The
Importannotation in Jetleaf is used to import other configuration classes. -
KeyValueOf<
K, V> - KeyValueOf Annotation
- Lazy
- Indicates that a pod should be lazily initialized.
- Named
- Explicitly specifies a name for a Pod (Dependency Injection component) that overrides all other naming mechanisms in the Jetleaf framework.
- OnApplicationFailed
- Annotation to mark a method that should run when the application fails to start or refresh.
- OnApplicationReady
- Annotation to mark a method that should run when the application is fully ready to serve requests.
- OnApplicationStarted
- Annotation to mark a method that should run when the application has started, meaning the context is refreshed but the app is not yet fully ready.
- OnApplicationStarting
- Annotation to mark a method that should run when the application is starting, before the context refresh occurs.
- OnApplicationStopped
- Annotation to mark a method that should run when the application has fully stopped.
- OnApplicationStopping
- Annotation to mark a method that should run when the application is stopping.
- OnContextLoaded
- Annotation to mark a method that should run when the application context has been loaded, but before it is fully refreshed.
- OnContextPrepared
- Annotation to mark a method that should run when the application context has been prepared.
- OnEnvironmentPrepared
- Annotation to mark a method that should run when the application environment has been prepared, but before the context is loaded.
- Order
- Specifies the order of precedence for a class when processed by the framework or runtime system.
- Pod
- Marks a method as a pod provider, enabling it to participate in the dependency injection (DI) lifecycle of the application.
- PostConstruct
- Marks a method to be invoked after a pod has been fully constructed and its dependencies injected, but before it is made available for use in the context.
- PreConstruct
- Marks a method to be invoked before a pod has been fully constructed and its dependencies injected, but before it is made available for use in the context.
- PreDestroy
- Marks a method to be invoked before a pod is destroyed.
- Primary
- Primary annotation for marking a primary pod
- Profile
- Profile annotation for profile-specific pods
- Qualifier
- A Jetleaf annotation used to disambiguate injection targets when multiple candidate pods of the same type exist.
- RequiredAll
- An annotation used for dependency injection that automatically injects all eligible fields into a class.
- Role
- Declares the design role of a class or method within a Jetleaf application.
- RunAfter
- A reflective annotation that declares that the annotated interceptor, filter, or handler should execute after one or more specified targets within the JetLeaf request processing pipeline.
- RunBefore
- A reflective annotation that declares that the annotated interceptor, filter, or handler should execute before one or more specified targets within the JetLeaf request processing pipeline.
- Scope
- Annotation that specifies the scope of a pod within the JetLeaf container.
- Service
- Service annotation for service layer components
-
TargetType<
T> - TargetType Annotation
- Value
- Value annotation for property injection
- WhenConditional
- The base class for all annotations that are eligible for conditional evaluation in the JetLeaf framework.
Enums
- FilterType
- Enumeration of supported filter types for component scanning.