All Questions
7 questions
0
votes
1
answer
52
views
How do I get the evaluated value from a StaticAnnotation's member?
So I have an annotation that looks like this:
class FakeAnnotation(val strings: String*) extends StaticAnnotation
val someVar = "Test"
@FakeAnnotation(someVar)
class TestClass
I can't see ...
0
votes
0
answers
142
views
Named parameters in Scala annotation
I have a Scala annotation with parameters, some with default values:
case class A(x: String, y: Option[String] = None, z: Option[Boolean] = None)
extends scala.annotation.StaticAnnotation
The ...
0
votes
1
answer
351
views
Play framework and reading a scala annotation
I am struggling to get a value from a scala annotation in a Play controller method.
I defined a class for the annotation:
case class Auth(perm: String) extends scala.annotation.StaticAnnotation
Then ...
1
vote
1
answer
1k
views
How to access scala annotation in scala code
I have defined a simple scala annoation and use it to annotate my case class Person:
package com.my
import scala.annotation.StaticAnnotation
@scala.annotation.meta.field
class Description(value: ...
0
votes
1
answer
249
views
How can I reflect on a field annotation (Java) in a Scala program?
I'm using Scala 2.13 and I know there's been a lot deprecated since older versions.
I've got this annotation:
@Inherited
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
@...
3
votes
1
answer
330
views
How to use Scala annotations in Java code
Is there any way to use annotations defined in Scala so they can work with Java code? I have a library with some annotations I would like to use in Java
1
vote
1
answer
112
views
Annotations on anonymous inner type
Is it possible to retrieve annotations on anonymous inner type?
I have an example below with which I could drill down to the field in the anonymous inner type via 2 routes and with both, no ...