Menu

#11 Support annotation at field level

closed
Annotations (1)
5
2012-02-02
2008-03-06
Mingfai
No

Currently, the @JSON annoation works in the method level. It is desirable to be allowed to define annotation at field level.

My reasons are:
1. Java Persistence API that defines @Entity annotation also support both field and method level annotation. I suppose it is a good practice.

2. Getter/setter generation. Getter and setters are usually generated by IDE, and may be removed and recreated.

3. Code clarity. member variables are listed at the first part of a class and it's more clear to read the @JSON annoation

Discussion

  • Charlie Hubbard

    Charlie Hubbard - 2012-02-02

    This was fixed long ago.

     
  • Charlie Hubbard

    Charlie Hubbard - 2012-02-02
    • labels: --> Annotations
    • assigned_to: nobody --> charliehubbard
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB