/** * probably a bit slow, calculates all the @Configured interfaces subclassing, useful * to find all possible subclasses of a type. * * @throws ClassNotFoundException */ private void initXRef() throws ClassNotFoundException { // force initialization of all the config models. for (ServiceHandle<?> i : habitat.getAllServiceHandles(ConfigInjector.class)) { buildModel((ActiveDescriptor<? extends ConfigInjector>) i.getActiveDescriptor()); } for (ConfigModel cm : models.values()) { Class targetType = cm.classLoaderHolder.loadClass(cm.targetTypeName); do { Class[] intfs = targetType.getInterfaces(); for (Class intf : intfs) { if (intf.isAnnotationPresent(Configured.class)) { addXRef(intf, cm); } } targetType = targetType.getSuperclass(); } while (targetType!=null); } }
/** * probably a bit slow, calculates all the @Configured interfaces subclassing, useful * to find all possible subclasses of a type. * * @throws ClassNotFoundException */ private void initXRef() throws ClassNotFoundException { // force initialization of all the config models. for (Inhabitant<? extends ConfigInjector> i : habitat.getInhabitants(ConfigInjector.class)) { buildModel(i); } for (ConfigModel cm : models.values()) { Class targetType = cm.classLoaderHolder.get().loadClass(cm.targetTypeName); do { Class[] intfs = targetType.getInterfaces(); for (Class intf : intfs) { if (intf.isAnnotationPresent(Configured.class)) { addXRef(intf, cm); } } targetType = targetType.getSuperclass(); } while (targetType!=null); } }
/** * probably a bit slow, calculates all the @Configured interfaces subclassing, useful * to find all possible subclasses of a type. * * @throws ClassNotFoundException */ private void initXRef() throws ClassNotFoundException { // force initialization of all the config models. for (ServiceHandle<?> i : habitat.getAllServiceHandles(ConfigInjector.class)) { buildModel((ActiveDescriptor<? extends ConfigInjector>) i.getActiveDescriptor()); } for (ConfigModel cm : models.values()) { Class targetType = cm.classLoaderHolder.loadClass(cm.targetTypeName); do { Class[] intfs = targetType.getInterfaces(); for (Class intf : intfs) { if (intf.isAnnotationPresent(Configured.class)) { addXRef(intf, cm); } } targetType = targetType.getSuperclass(); } while (targetType!=null); } }
/** * probably a bit slow, calculates all the @Configured interfaces subclassing, useful * to find all possible subclasses of a type. * * @throws ClassNotFoundException */ private void initXRef() throws ClassNotFoundException { // force initialization of all the config models. for (ServiceHandle<?> i : habitat.getAllServiceHandles(ConfigInjector.class)) { buildModel((ActiveDescriptor<? extends ConfigInjector>) i.getActiveDescriptor()); } for (ConfigModel cm : models.values()) { Class targetType = cm.classLoaderHolder.loadClass(cm.targetTypeName); do { Class[] intfs = targetType.getInterfaces(); for (Class intf : intfs) { if (intf.isAnnotationPresent(Configured.class)) { addXRef(intf, cm); } } targetType = targetType.getSuperclass(); } while (targetType!=null); } }