Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-162

Groovy-friendly macro parameter annotations

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Macro
    • Labels:
      None
    • Similar issues:

      Description

      In Groovy, we're used to define "properties" like so:

      class MyParams {
          @PropertyMandatory
          String name
      }
      

      It generates a private field, a getter, and a setter.
      But Groovy "puts" the annotation on the private field.
      And the macro parameters and their annotations (like @PropertyMandatory) only work on setters and public fields.
      So in Groovy, the @PropertyMandatory annotation was simply ignored.

      It would be nice if such situations were handled so that idiomatic Groovy can be used.

      Remark: suffice to add the public keyword to create a public field, so it's an okay workaround.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              glaforge Guillaume Laforge
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: