Created
November 21, 2019 15:10
-
-
Save bastman/95a56937dbf34fee5a4453c1c5e43b98 to your computer and use it in GitHub Desktop.
spring-kotlin: custom annotations example
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
/** | |
* Annotations: @RestApiQueryHandler, @RestApiMutationHandler | |
* as specialization of @Component | |
* see: @Service for impl. | |
* | |
*/ | |
import org.springframework.core.annotation.AliasFor | |
import org.springframework.stereotype.Component | |
@kotlin.annotation.Target(AnnotationTarget.CLASS) | |
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) | |
@MustBeDocumented | |
@Component | |
annotation class RestApiQueryHandler( | |
@get: AliasFor(annotation = Component::class) | |
val value: String = "" | |
) | |
@kotlin.annotation.Target(AnnotationTarget.CLASS) | |
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) | |
@MustBeDocumented | |
@Component | |
annotation class RestApiMutationHandler( | |
@get: AliasFor(annotation = Component::class) | |
val value: String = "" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment