Scala 2.8: use Java annotation with an array parameter
Posted
by yournamehere
on Stack Overflow
See other posts from Stack Overflow
or by yournamehere
Published on 2010-05-16T00:17:19Z
Indexed on
2010/05/16
0:30 UTC
Read the original article
Hit count: 337
scala-2.8
I'm trying to implement an JavaEE Session Bean with Scala 2.8.
Because it's a Remote Session Bean, i have to annotate it with the following Java Annotation:
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Remote {
Class[] value() default {};
}
I only found this example for scala 2.7. In Scala 2.7, its possible to define the session bean like this:
@Remote {val value = Array(classOf[ITest])}
class MyEJB
...
How can i use this annotation the same way with Scala 2.8? I already tried many different versions, all resulting in "annotation argument needs to be a constant", "illegal start of simple expression". All of these definitions don't work:
@Remote{val value = Array(classOf[PersonScalaEJB])}
@Remote(val value = Array(classOf[PersonScalaEJB]))
@Remote(Array(classOf[PersonScalaEJB]))
© Stack Overflow or respective owner