mercredi 17 février 2021

How to parse Java annotation in generic type?

I have annotation like this:

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE_USE)
public @interface NotNull {}

And have a class:

class Main{
   List<@NotNull String> list;
}

How should i parse this annotation using Reflection API?





Aucun commentaire:

Enregistrer un commentaire