[MAGNOLIA-5263] Allow specifying transformer via @TransformedBy on class or annotation Created: 26/Aug/13 Updated: 02/Feb/15 Resolved: 04/Aug/14 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.2 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Magnolia International | Assignee: | Magnolia International |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Patch included: |
Yes
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||
| 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 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. |
| Comments |
| Comment by Magnolia International [ 30/Jul/14 ] |
|
Someone with more functioning brain cells could read this and understand if adding the @Target values of this patch breaks binary compatibility. If not, we could possibly implement this change in 5.3.x, which in turn means means that we could release |
| Comment by Magnolia International [ 04/Aug/14 ] |
|
Pushed on feature/ |