本文整理汇总了Java中org.springframework.boot.autoconfigure.AutoConfigurationPackages.get方法的典型用法代码示例。如果您正苦于以下问题:Java AutoConfigurationPackages.get方法的具体用法?Java AutoConfigurationPackages.get怎么用?Java AutoConfigurationPackages.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.autoconfigure.AutoConfigurationPackages
的用法示例。
在下文中一共展示了AutoConfigurationPackages.get方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerBeanDefinitions
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
logger.debug("Searching for mappers annotated with @Mapper");
ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
try {
if (this.resourceLoader != null) {
scanner.setResourceLoader(this.resourceLoader);
}
List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
if (logger.isDebugEnabled()) {
for (String pkg : packages) {
logger.debug("Using auto-configuration base package '" + pkg + "'");
}
}
scanner.setAnnotationClass(Mapper.class);
scanner.registerFilters();
scanner.doScan(StringUtils.toStringArray(packages));
} catch (IllegalStateException ex) {
logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled." + ex);
}
}
示例2: registerBeanDefinitions
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
logger.debug("Searching for mappers annotated with @Mapper");
ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
scanner.setMapperProperties(environment);
try {
if (this.resourceLoader != null) {
scanner.setResourceLoader(this.resourceLoader);
}
List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
if (logger.isDebugEnabled()) {
for (String pkg : packages) {
logger.debug("Using auto-configuration base package '{}'", pkg);
}
}
scanner.setAnnotationClass(Mapper.class);
scanner.registerFilters();
scanner.doScan(StringUtils.toStringArray(packages));
} catch (IllegalStateException ex) {
logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
}
}
示例3: createClassPathMapperScanner
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
private void createClassPathMapperScanner(BeanDefinitionRegistry registry, String prefixName) {
ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
try {
if (this.resourceLoader != null) {
scanner.setResourceLoader(this.resourceLoader);
}
List<String> packages = AutoConfigurationPackages.get(beanFactory);
packages.forEach(pkg -> log.info("Using auto-configuration base package '{}'", pkg));
scanner.setAnnotationClass(Mapper.class);
scanner.setSqlSessionFactoryBeanName(prefixName + "SessionFactory");
scanner.registerFilters();
scanner.doScan(StringUtils.toStringArray(packages));
} catch (IllegalStateException ex) {
log.info("Could not determine auto-configuration package", ex);
}
}
示例4: registerBeanDefinitions
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
logger.debug("Searching for mappers annotated with @Mapper");
ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
try {
if (this.resourceLoader != null) {
scanner.setResourceLoader(this.resourceLoader);
}
List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
if (logger.isDebugEnabled()) {
packages.forEach(pkg -> logger.debug("Using auto-configuration base package '{}'", pkg));
}
scanner.setAnnotationClass(Mapper.class);
scanner.registerFilters();
scanner.doScan(StringUtils.toStringArray(packages));
} catch (IllegalStateException ex) {
logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
}
}
示例5: getScannerConfigurer
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
@Bean
public DaoScannerConfigurer getScannerConfigurer() {
// Try to use @EnableAutoConfiguration base packages
List<String> basePackages = null;
try {
basePackages = AutoConfigurationPackages.get(context);
} catch (Exception e) {
}
if (basePackages == null || basePackages.size() == 0)
return null;
DaoScannerConfigurer cfg = new DaoScannerConfigurer();
cfg.setBasePackage(basePackages.stream().collect(
Collectors.joining(",")));
return cfg;
}
示例6: registerBeanDefinitions
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
List<String> packages = AutoConfigurationPackages.get(beanFactory);
registerDubboService(packages, registry);
registerDubboReference(registry);
}
开发者ID:justice-code,项目名称:dubbo-spring-boot-autoconfig,代码行数:9,代码来源:AutoConfiguredDubboScannerRegistrar.java
示例7: getPackagesToScan
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
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()]);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:Neo4jDataAutoConfiguration.java
示例8: cassandraMapping
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
@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;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:CassandraDataAutoConfiguration.java
示例9: getPackages
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
private List<String> getPackages() {
List<String> packages = EntityScanPackages.get(this.context).getPackageNames();
if (packages.isEmpty() && AutoConfigurationPackages.has(this.context)) {
packages = AutoConfigurationPackages.get(this.context);
}
return packages;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:EntityScanner.java
示例10: getPackagesToScan
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
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()]);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:JpaBaseConfiguration.java
示例11: getMappingBasePackages
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
private static Collection<String> getMappingBasePackages(BeanFactory beanFactory) {
try {
return AutoConfigurationPackages.get(beanFactory);
}
catch (IllegalStateException ex) {
// no auto-configuration package registered yet
return Collections.emptyList();
}
}
示例12: getPackagesToScan
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
protected String[] getPackagesToScan() {
if (AutoConfigurationPackages.has(this.beanFactory)) {
List<String> basePackages = AutoConfigurationPackages
.get(this.beanFactory);
return basePackages.toArray(new String[basePackages.size()]);
}
return new String[0];
}
示例13: getPackagesToScan
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
protected String[] getPackagesToScan() {
if (AutoConfigurationPackages.has(this.beanFactory)) {
List<String> basePackages = AutoConfigurationPackages.get(this.beanFactory);
return basePackages.toArray(new String[basePackages.size()]);
}
return NO_PACKAGES;
}
示例14: getBasePackages
import org.springframework.boot.autoconfigure.AutoConfigurationPackages; //导入方法依赖的package包/类
protected Iterable<String> getBasePackages() {
return AutoConfigurationPackages.get(this.beanFactory);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:AbstractRepositoryConfigurationSourceSupport.java