Generic types in annotations

前端 未结 2 1181
悲哀的现实
悲哀的现实 2020-12-11 20:19

Consider the following code:

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class AnnotationTest {

    @Generic         


        
2条回答
  •  心在旅途
    2020-12-11 21:01

    Not having generic annotations is sadly a limitation of the framework. One solution is to have a field describing the desired class and checking/casting types at runtime.

提交回复
热议问题