Java 类org.springframework.boot.autoconfigure.domain.EntityScanPackages 实例源码

项目:holon-datastore-jpa    文件:JpaAutoConfigurationRegistrar.java   
/**
 * Gets package names to scan to detect JPA Entity classes, using {@link JpaEntityScan} (or {@link EntityScan} for
 * default data context id) annotation.
 * @param dataContextId Data context id
 * @return Package names to scan to detect JPA Entity classes
 */
protected String[] getPackagesToScan(String dataContextId) {
    List<String> packages = JpaEntityScanPackages.get(beanFactory, dataContextId).getPackageNames();
    if (packages.isEmpty() && dataContextId == null) {
        packages = EntityScanPackages.get(beanFactory).getPackageNames();
    }
    return packages.toArray(new String[packages.size()]);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:Neo4jDataAutoConfiguration.java   
private String[] getPackagesToScan() {
    List<String> packages = EntityScanPackages.get(this.applicationContext)
            .getPackageNames();
    if (packages.isEmpty()
            && AutoConfigurationPackages.has(this.applicationContext)) {
        packages = AutoConfigurationPackages.get(this.applicationContext);
    }
    return packages.toArray(new String[packages.size()]);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CassandraDataAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public CassandraMappingContext cassandraMapping() throws ClassNotFoundException {
    BasicCassandraMappingContext context = new BasicCassandraMappingContext();
    List<String> packages = EntityScanPackages.get(this.beanFactory)
            .getPackageNames();
    if (packages.isEmpty() && AutoConfigurationPackages.has(this.beanFactory)) {
        packages = AutoConfigurationPackages.get(this.beanFactory);
    }
    if (!packages.isEmpty()) {
        context.setInitialEntitySet(CassandraEntityClassScanner.scan(packages));
    }
    return context;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JpaBaseConfiguration.java   
protected String[] getPackagesToScan() {
    List<String> packages = EntityScanPackages.get(this.beanFactory)
            .getPackageNames();
    if (packages.isEmpty() && AutoConfigurationPackages.has(this.beanFactory)) {
        packages = AutoConfigurationPackages.get(this.beanFactory);
    }
    return packages.toArray(new String[packages.size()]);
}
项目:spring-cloud-stream    文件:SchemaServerConfiguration.java   
@Bean
public static BeanFactoryPostProcessor entityScanPackagesPostProcessor() {
    return new BeanFactoryPostProcessor() {

        @Override
        public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
            if (beanFactory instanceof BeanDefinitionRegistry) {
                EntityScanPackages.register((BeanDefinitionRegistry) beanFactory,
                        Collections.singletonList(Schema.class.getPackage().getName()));
            }
        }
    };
}