[
https://issues.apache.org/jira/browse/THRIFT-3446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15048511#comment-15048511
]
Jens Geyer commented on THRIFT-3446:
------------------------------------
There are some similarities to THRIFT-3339 and to the various C# switches that
deal with serialization attributes.
Nevertheless, I think that these kind of things tend to be highly
language-specific. So although I see the general use case, the implementations
vary which makes it too amorphous to fit in exactly one pattern. Which lets me
believe, that (a) yes we should strive to a more general form of how it is
implemented, but (b) we should leave enough room for language-specific
considerations. We already have annotations and switches, which should be used
in a way that makes the most sense. I'm deliberately vague here, as you might
notice.
Last not least, another interesting question raises: How does this fit into the
general vision of Thrift as an RPC- and *serialization* framework? It is an
important question, because the answer to that question basically tells us,
whether or not support for such things should become a first-class citizen in
Thrift, or whether it should be left as something that is just "supported"
somehow, but not really considered a core competence of Thrift.
I can't answer that question alone, but from my feeling we probably need to
form some consensus here.
> 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)