byte-buddy
byte-buddy copied to clipboard
how to use byte-buddy to handle annotation
Regarding the use of byte-buddy, I have 2 questions, which are as follows:
- How to remove the annotation above the class;
- How to change the attribute value in the annotation of the class attribute; In order to avoid that I did not make it clear, I will give the corresponding example below. Example 1: I just want to remove the @Aspect annotation on class A. before
@Aspect
@Slf4j
Class A{
}
after
@Slf4j
Class A{
}
Example 2: I want to change the value of name in the @Resource annotation of attribute a in class B from a to b before
Class B{
@Resource(name="a")
private A a;
}
after
Class B{
@Resource(name="b")
private A a;
}
Referring to this issue, I found a solution, but the solution time of the above issue is in 2020. With the recent upgrades, is there a simpler and more suitable alternative?
As pointed out, removal is not currently well-supported. Unfortunately, this is still true today.