This page is no longer maintained — Please continue to the home page at www.scala-lang.org

annotations and case class parameters

2 replies
Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Is there a way to get Java annotations with RUNTIME visibility applied to the constructor parameters of a case class to show up on the public accessor methods associated with them?  Or if not the methods, the private fields?
It seems that even if the ElementType is FIELD or METHOD, the annotations are applied to the parameters of the apply method on the automatically generated companion object.
Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: annotations and case class parameters

http://www.scala-lang.org/api/current/scala/annotation/target/package.html

On Sun, Oct 24, 2010 at 9:36 PM, Erik Engbrecht
wrote:
> Is there a way to get Java annotations with RUNTIME visibility applied to
> the constructor parameters of a case class to show up on the public accessor
> methods associated with them?  Or if not the methods, the private fields?
> It seems that even if the ElementType is FIELD or METHOD, the annotations
> are applied to the parameters of the apply method on the automatically
> generated companion object.

Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Re: annotations and case class parameters
That worked, thanks!
On Sun, Oct 24, 2010 at 4:09 PM, Jason Zaugg <jzaugg [at] gmail [dot] com> wrote:
http://www.scala-lang.org/api/current/scala/annotation/target/package.html

On Sun, Oct 24, 2010 at 9:36 PM, Erik Engbrecht
<erik [dot] engbrecht [at] gmail [dot] com> wrote:
> Is there a way to get Java annotations with RUNTIME visibility applied to
> the constructor parameters of a case class to show up on the public accessor
> methods associated with them?  Or if not the methods, the private fields?
> It seems that even if the ElementType is FIELD or METHOD, the annotations
> are applied to the parameters of the apply method on the automatically
> generated companion object.



--
http://erikengbrecht.blogspot.com/

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland