문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top