Add Guice modules to Governator.

@param modules Guice modules to add.
@return this
494075
public Governator addModules(List<Module> modules) {
        if (modules != null) {
            this.modules.addAll(modules);
        }
        return this;
    }
716210
@SafeVarargs
    public static <M extends AbstractModule> Injector injector(Class<M>... modules) {
        List<String> names = new ArrayList<String>(modules.length);
        for (Class<?> klass : modules) {
            names.add(klass.getName());
        }
        return ngo.injector(JSArray.create(names.toArray(EMPTY_STRING_ARRAY)));
    }
1242931
protected void initializeComponents(Collection<String> modules) {

        Iterator<CmsSetupComponent> itGroups = new ArrayList<CmsSetupComponent>(
            CmsCollectionsGenericWrapper.<CmsSetupComponent> list(m_components.elementList())).iterator();
        while (itGroups.hasNext()) {
            CmsSetupComponent component = itGroups.next();
            String errMsg = "";
            String warnMsg = "";
            // check name
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(component.getName())) {
                errMsg += Messages.get().container(Messages.ERR_COMPONENT_NAME_EMPTY_1, component.getId()).key();
                errMsg += "\n";
            }
            // check description
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(component.getName())) {
                warnMsg += Messages.get().container(Messages.LOG_WARN_COMPONENT_DESC_EMPTY_1, component.getId()).key();
                warnMsg += "\n";
            }
            // check position
            if (component.getPosition() == DEFAULT_POSITION) {
                warnMsg += Messages.get().container(Messages.LOG_WARN_COMPONENT_POS_EMPTY_1, component.getId()).key();
                warnMsg += "\n";
            }
            // check dependencies
            Iterator<String> itDeps = component.getDependencies().iterator();
            while (itDeps.hasNext()) {
                String dependency = itDeps.next();
                if (m_components.getObject(dependency) == null) {
                    errMsg += Messages.get().container(
                        Messages.LOG_WARN_COMPONENT_DEPENDENCY_BROKEN_2,
                        component.getId(),
                        dependency).key();
                    errMsg += "\n";
                }
            }
            // check modules match
            boolean match = false;
            Iterator<String> itModules = modules.iterator();
            while (itModules.hasNext()) {
                String module = itModules.next();
                if (component.match(module)) {
                    match = true;
                    itModules.remove();
                }
            }
            if (!match) {
                errMsg += Messages.get().container(Messages.ERR_COMPONENT_MODULES_EMPTY_1, component.getId()).key();
                errMsg += "\n";
            }

            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(errMsg)) {
                m_components.removeObject(component.getId());
                if (LOG.isErrorEnabled()) {
                    LOG.error(errMsg);
                }
            }
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(warnMsg)) {
                if (LOG.isWarnEnabled()) {
                    LOG.warn(warnMsg);
                }
            }
        }
        if (!modules.isEmpty()) {
            if (LOG.isWarnEnabled()) {
                LOG.warn(Messages.get().container(Messages.LOG_WARN_MODULES_LEFT_1, modules.toString()));
            }
        }
    }
202300
public void addModule(Module module) {
        LOGGER.debug("adding module {}", module);
        module.setupModule(new ModuleContextImpl(module));
        modules.add(module);
    }
1213
public static final Kernel create(Module... modules) {
		final Injector injector = Guice.createInjector(modules);
		final Kernel k = injector.getInstance(Kernel.class);
		return k;
	}
593451
private void addModules(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) {
        File projectDirectory = project.getBasedir();
        Set<File> modules = new HashSet<>();
        for (String moduleName : project.getModules()) {
            File module = new File(projectDirectory, moduleName);
            modules.add(module);
        }
        for (MavenProject module : project.getCollectedProjects()) {
            if (modules.contains(module.getBasedir())) {
                MavenProjectDescriptor moduleDescriptor = resolveProject(module, MavenProjectDescriptor.class, scannerContext);
                projectDescriptor.getModules().add(moduleDescriptor);
            }
        }
    }
983754
public void addImportedPackages(Set<String> importedPackages) {
		addImportedPackages(importedPackages.toArray(new String[importedPackages.size()]));
	}
650161
public ProviderGroup addAll(Collection<ProviderInfo> providerInfos) {
        if (CommonUtils.isEmpty(providerInfos)) {
            return this;
        }
        ConcurrentHashSet<ProviderInfo> tmp = new ConcurrentHashSet<ProviderInfo>(this.providerInfos);
        tmp.addAll(providerInfos); // 排重
        this.providerInfos = new ArrayList<ProviderInfo>(tmp);
        return this;
    }
1236574
@Override
    public T addAsModules(final File... resources) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(resources, "resources must be specified");

        // Add each
        for (final File resource : resources) {
            this.addAsModule(resource);
        }

        // Return
        return this.covarientReturn();
    }
358735
protected HalRepresentation add(final Links links) {
        this.links = this.links != null
                ? copyOf(this.links).with(links).build()
                : links.using(this.curies);
        if (embedded != null) {
            embedded = embedded.using(this.curies);
        }
        return this;
    }
552131
public InjectorBuilder combineWith(Module ... modules) {
        List<Module> m = new ArrayList<>();
        m.add(module);
        m.addAll(Arrays.asList(modules));
        this.module = Modules.combine(m);
        return this;
    }
177866
public void contributeToModule() {
		final GuiceModuleAccess module = this.module.get();
		if (!this.removableBindings.isEmpty()) {
			// Ok, we are broking the Java secutiry manager.
			// But it's for having something working!
			try {
				final Field field = module.getClass().getDeclaredField("bindings"); //$NON-NLS-1$
				final boolean accessible = field.isAccessible();
				try {
					field.setAccessible(true);
					final Collection<?> hiddenBindings = (Collection<?>) field.get(module);
					hiddenBindings.removeAll(this.removableBindings);
				} finally {
					field.setAccessible(accessible);
				}
			} catch (Exception exception) {
				throw new IllegalStateException(exception);
			}
		}
		module.addAll(this.bindings);
	}
266903
@Override
    protected Stream<Module> buildGuiceModules() {
        return Stream.concat(Stream.concat(
                    super.buildGuiceModules(),
                    sqlConfiguration.buildGuiceModules()),
                Stream.of(
                        new OntopMappingSQLModule(this),
                        new OntopMappingPostModule(getSettings())));
    }
469464
def add_to_loaded_modules(self, modules):
        
        modules = util.return_set(modules)
        for module in modules:
            if not isinstance(module, str):
                module = module.__name__
            self.loaded_modules.add(module)
554957
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) {
        if (softwareModules == null) {
            softwareModules = new ArrayList<>();
        }

        softwareModules.add(createSoftwareModule);

    }
477867
public static void addSupport(AbstractModule module) {
        module.bindInstance(SQLCodegenModule.ENTITYPATH_TYPE, RelationalPathSpatial.class);
        registerTypes(module.get(Configuration.class));
        registerTypes(module.get(TypeMappings.class));
        addImports(module);
    }
1373571
public Authorizations addRoles(String... roles) {
        for (String role : roles) {
            addRole(new Role(role));
        }

        return this;
    }