How to add a field to a custom-annotated class using AspectJ

后端 未结 2 854
北海茫月
北海茫月 2021-02-11 03:49

To add a field to some specific class with aspectj we do

package com.test;

public class MyClass {
    private String myField;
}

public aspect MyAspect
{
    pr         


        
2条回答
  •  我寻月下人不归
    2021-02-11 04:42

    You can create a pointcut for any type with a particular annotation. See Join Point Matching based on Annotations.

提交回复
热议问题