lundi 11 juin 2018

RetentionPolicy.RUNTIME doesn't exist?

Currently I'm working on a simple annotation, but for this I need to add the following annotation to the annotation to be able to use reflection on it:

@Retention(RetentionPolicy.RUNTIME)
public @interface Cmd {
    String permission() default "";
    String description() default "";
    String[] fireOn();
}

But for some reason this RetentionPolicy is not something that I can import and doesn't get recognized by the compiler at all.

On top of this, I got all information from official documents that also use the RetentionPolicy.RUNTIME enum.

Maybe this is a really stupid question, and I'm sorry for that. On the contrary I think more people run into this problem and can't find a clear solution.

So I'm looking forward to reactions to my issue that could clearify everything for me and other people.

-DutchJelly





Aucun commentaire:

Enregistrer un commentaire