我有命令界面
public interface ICommand {...}
和与特定命令关联的处理程序接口
public interface ICommandHandler<T extends ICommand> { IResponse handle(T command); }
例如,我有具体的命令
public class GetCatalogById implements ICommand{ private final long catalogId; public GetCatalogById(long catalogId) { this.catalogId = catalogId; } public long getCatalogId() { return catalogId; } }
如何以编程方式获取项目中所有类的列表(列表)
implements ICommandHandler<GetCatalogById>
?
我具有命令接口公共接口ICommand {...}和与特定命令公共接口ICommandHandler相关的处理程序接口
您的问题可以分为2个子问题:
ICommandHandler
的所有类的列表