-
Improvement
-
Resolution: Fixed
-
Neutral
-
None
-
None
-
-
Yes
-
Empty show more show less
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.
- is depended upon by
-
MGNLCACHE-55 Caching arbitrary objects
- Closed
- supersedes
-
MAGNOLIA-4648 Node2Bean: Allow specifying transformers via annotation
- Closed