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

Allow specifying transformer via @TransformedBy on class or annotation

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 5.3.2
    • None
    • core
    • None
    • Yes

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Task DoD