This repository has been archived by the owner on Feb 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43918b9
commit 70c375f
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
kinzhal-annotations/src/commonMain/kotlin/com/daugeldauge/kinzhal/annotations/Annotations.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,38 @@ | ||
@file:Suppress("KDocUnresolvedReference") | ||
|
||
package com.daugeldauge.kinzhal.annotations | ||
|
||
import kotlin.reflect.KClass | ||
|
||
/** | ||
* Annotates an interface for which dependency-injected implementation | ||
* is to be generated from a set of [modules]. The generated class will | ||
* have the name of the type annotated with [Component] prepended with | ||
* Kinzhal. For example, `@Component interface AppComponent` will | ||
* produce an implementation named KinzhalAppComponent. All [dependencies] | ||
* will be primary constructor parameters of generated class. | ||
*/ | ||
@Retention(AnnotationRetention.SOURCE) | ||
@Target(AnnotationTarget.CLASS) | ||
annotation class Component(val modules: Array<KClass<*>> = [], val dependencies: Array<KClass<*>> = []) | ||
|
||
/** | ||
* Equivalent of [javax.inject.Inject]. Only a constructor injection is supported for now | ||
*/ | ||
@Retention(AnnotationRetention.SOURCE) | ||
@Target(AnnotationTarget.CONSTRUCTOR) | ||
annotation class Inject | ||
|
||
/** | ||
* Equivalent of [javax.inject.Scope] | ||
*/ | ||
@Retention(AnnotationRetention.SOURCE) | ||
@Target(AnnotationTarget.ANNOTATION_CLASS) | ||
annotation class Scope | ||
|
||
/** | ||
* Equivalent of [javax.inject.Qualifier] | ||
*/ | ||
@Retention(AnnotationRetention.SOURCE) | ||
@Target(AnnotationTarget.ANNOTATION_CLASS) | ||
annotation class Qualifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters