Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6664009

compiler generated accessor methods

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE REQUEST :
      I like the notion of Java annotations a lot. It is probably not a new idea, but I would like a @Property annotation for fields. Using the annotation parameters, the compiler could create a simple getter and/or setter, both of which could have an annotation-list.

      JUSTIFICATION :
      Although tools help in generating these methods, it is not automatic when the fields change. This would also allow bean classes to look nicer.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      @Property(type=READ_WRITE, getterAnnotations={"@javax.persistence.Id"})
      int id;

      type=READ_WRITE could be the default. Most of the time a @Property would be sufficient.

      For subannotations with a parameter list, this syntax is not good enough, in this case a manual declaration would be necessary.

        Attachments

          Activity

            People

            • Assignee:
              darcy Joe Darcy
              Reporter:
              ryeung Roger Yeung (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: