Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5263

Allow specifying transformer via @TransformedBy on class or annotation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3.2
    • Component/s: core
    • Labels:
      None
    • Patch included:
      Yes

      Description

      Currently, the @TransformedBy annotation is only supported at method level - i.e on the setter of a given type. However, it could be practical, and probably more useful, to specify it at class level.

      The attached patch allows specifying @TransformedBy on class. It also even allows to specify a transformer on another annotation: if @MyAnnotation is itself annotated with @TransformedBy(SomeTransformer.class), then any class annotated with @MyAnnotation will be transformed with SomeTransformer. I had use-case for this with MGNLUI-1826, but this isn't the case anymore.

      I don't remember exactly what the first part of the patch was for - unrelated IIRC - was fixing some issue with "indexed properties" (which we normally don't use IIRC). It can probably be ignored for this specific feature - attached patch has no tests, please write some before applying.

      Additionally, please add the @Documented annotation to @TransformedBy.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gjoseph Magnolia International
              Reporter:
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: