Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11191

Control/alias properties for collected annotations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0.13
    • None
    • Compiler
    • None

    Description

      @AnnotationCollector automatically and inflexibly maps properties on the collection annotation onto the collected annotations. This is particularly inconvenient when multiple annotations declare a property value():

      @JsonTypeName // String value()
      @CompileStatic // TypeCheckingMode value()
      @AnnotationCollector
      @interface StaticBody {}
      

      Currently, the only way to support such behavior is to subclass AnnotationCollectorTransform and hand-write it (and I'm not even sure how, since the logic is not simple). It would be immensely helpful to be able to declaratively alias or even suppress mapping certain properties onto certain collected annotations (e.g., it would solve my use case to be able to skip applying value() to CompileStatic above).

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: