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

Groovy-friendly macro parameter annotations

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • Macro
    • None

    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

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

            Dates

              Created:
              Updated: