[
https://issues.apache.org/jira/browse/THRIFT-3446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15048720#comment-15048720
]
James E. King, III commented on THRIFT-3446:
--------------------------------------------
It would be somewhat odd to have language-specific idioms in the Thrift IDL
that don't carry to all of the languages. While it sounds interesting I don't
think it would be useful to enough languages to be warranted, plus one should
be able to use reflection to get the field names instead of the annotations, so
using good field names would probably suffice for the example provided. This
doesn't sound like a common use case at this time. I would be fine saying this
is a feature the core library won't implement. If you modify the compiler to
implement this please do submit a patch though - whether it is taken or not the
patch might be useful to others. If there seems to be enough interest the
issue can always be re-opened.
> Add support for annotations
> ---------------------------
>
> Key: THRIFT-3446
> URL: https://issues.apache.org/jira/browse/THRIFT-3446
> Project: Thrift
> Issue Type: Wish
> Components: C# - Compiler, Java - Compiler
> Reporter: Siddharth Jain
> Priority: Minor
>
> I understand currently it is not possible to write a thrift file which when
> compiled will generate java code that can have annotations in it. I am
> working on a project in which I need the fields in generated java classes to
> have annotations on them e.g., in below I have defined a annotation named
> Column that is used on fields in MyClass:
> @Retention(value= RetentionPolicy.RUNTIME)
> @interface Column {
> int value() default -1;
> }
> public class MyClass {
> @Column(0)
> private String stateFP;
>
> @Column(1)
> private String countyFP;
>
> @Column(2)
> private String countyNS;
>
> @Column(3)
> private String geoid;
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)