如何在类路径中找到所有接口实现? [英] How can I find all implementations of interface in classpath?

查看:142
本文介绍了如何在类路径中找到所有接口实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现一个接口,现在我想在classpath中获得该接口的所有实现。这可能还是我应该做些什么?

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?

推荐答案

充其量,这将是昂贵的。最糟糕的情况(取决于类加载器)可能是不可能的。

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.

这篇关于如何在类路径中找到所有接口实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆