How can I find all implementations of interface in classpath?

后端 未结 2 1532
鱼传尺愫
鱼传尺愫 2020-12-19 01:29

I\'m implementing an interface and now I\'d like to get all implementations of this interface in classpath. Is this possible or should I do something else?

2条回答
  •  执念已碎
    2020-12-19 01:30

    At best, this will be expensive. At worst (depending on the classloaders) it may be impossible.

    I strongly suggest that you look for an alternative approach to the underlying problem that you are trying to address.

提交回复
热议问题