[英]Is it possible to create a custom annotation with a group of annotations in Java?
我在我的系統中使用了lombok和JPA。 所以對於實體類,它們看起來像:
@Getter
@Setter
@Entity
@NoArgsConstructor
@AllArgsConstructor
public class XxxEntity {
...
}
所以我的問題是,我可以創建一個自定義注釋來分組這些所有這些注釋嗎?
所以它可能看起來像:
@CustomAnnotation
public class XxxEntity {
...
}
當我使用@CustomAnnotation時,它會將所有上述注釋應用於該類。
這可能嗎?
謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.