Is it possible to define CDI Stereotypes in Scala?
-
25-10-2019 - |
문제
To define a CDI stereotype, i would need to define a runtime annotation. In scala, i tried this:
@Stereotype
@Target(Array(ElementType.METHOD))
@Retention(RetentionPolicy.RUNTIME)
//... my stereotype annotations
class MyStereotype extends ClassfileAnnotation{}
But found this problem:
Implementation restriction: subclassing Classfile does not make your annotation visible at runtime. If that is what you want, you must write the annotation class in Java.
Is it possible, using scala 2.9.1, to define runtime annotations?
해결책
This is purely a Scala issue where runtime renentive annotations must be done in Java. So CDI (as well as other stereotypes) should be done in Java.
제휴하지 않습니다 StackOverflow