vendredi 20 novembre 2015

How to scan to find Java (child) interfaces

Given an interface:

public interface A {};

with inheriting interfaces:

public interface B extends A {}

public interface C extends A {}

How can I programmatically scan to find B and C? I.e. how to do this:

Type[] types = findAllSubInterfacesOfA(); // Returns [B.class, C.class]

Note: Am trying to find interfaces here, not classes or instances.





Aucun commentaire:

Enregistrer un commentaire