jeudi 15 octobre 2020

Get Scala annotation from Java Method

I have an instance of Java Method that represents a Scala function with a Scala annotation (that extends StaticAnnotation). I know I can use Method.getAnnotation(classOf[SomeJavaAnnotation]) to get a Java annotation, but this returns null for Scala annotations.

How can I get the Scala annotation from this? It seems I need to convert it to a Scala MethodSymbol first, but I don't see an obvious way to do that and I've only seen resources showing how to go the other way (from Scala MethodSymbol to Java Method).





Aucun commentaire:

Enregistrer un commentaire