jeudi 11 avril 2019

Can I use a class type parameter inside an annotation?

Think about the given scenario:

public @interface SomeThirdAnnotation {
    Class<? extends Something> value();
}

@SomeThirdAnnotation(T)
public abstract class MyClass<T extends Something> {
    // my code
}

Can this be possible in JAVA?

Is there any way to use a class type parameter inside annotations, because doing it will drastically remove code from the abstract class children.

Thank you very much for those who try to help me.





Aucun commentaire:

Enregistrer un commentaire