Java Code Examples for org.springframework.boot.autoconfigure.EnableAutoConfiguration

The following examples show how to use org.springframework.boot.autoconfigure.EnableAutoConfiguration. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void onAutoConfigurationImportEvent(AutoConfigurationImportEvent event) {
    // 获取当前 ClassLoader
    ClassLoader classLoader = event.getClass().getClassLoader();
    // 候选的自动装配类名单
    List<String> candidates =
            SpringFactoriesLoader.loadFactoryNames(EnableAutoConfiguration.class, classLoader);
    // 实际的自动装配类名单
    List<String> configurations = event.getCandidateConfigurations();
    // 排除的自动装配类名单
    Set<String> exclusions = event.getExclusions();
    // 输出各自数量
    System.out.printf("自动装配类名单 - 候选数量:%d,实际数量:%d,排除数量:%s\n",
            candidates.size(), configurations.size(), exclusions.size());
    // 输出实际和排除的自动装配类名单
Example 2
public void add(Class<?> importer, String typeName) {
	if (typeName.endsWith(".xml")) {
		this.registrars.add(new Imported(importer, typeName, context));
	else {
		if (isAutoConfiguration(importer, typeName) && !context.getEnvironment()
				.getProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, Boolean.class, true)) {
		this.registrars.add(new Imported(importer, typeName, context.getClassLoader()));
Example 3
Source Project: butterfly   Source File:    License: MIT License 4 votes vote down vote up
public void fqdnTest() throws ParseException {
    AnnotatedWith annotatedWith = new AnnotatedWith(EnableAutoConfiguration.class);
Example 4
Source Project: onetwo   Source File:    License: Apache License 2.0 4 votes vote down vote up
public void test(){
	List<String> names = SpringFactoriesLoader.loadFactoryNames(EnableAutoConfiguration.class, ClassUtils.getDefaultClassLoader());