本文整理了Java中io.micronaut.context.env.Environment.addPackage()
方法的一些代码示例,展示了Environment.addPackage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.addPackage()
方法的具体详情如下:
包路径:io.micronaut.context.env.Environment
类名称:Environment
方法名:addPackage
[英]Add an application package. Application packages are candidates for scanning for tools that need it (such as JPA or GORM).
[中]添加一个应用程序包。应用程序包是扫描需要它的工具(如JPA或GORM)的候选程序。
代码示例来源:origin: io.micronaut/micronaut-inject
/**
* Add an application package. Application packages are candidates for scanning for tools that need it (such as JPA
* or GORM).
*
* @param pkg The package to add
* @return This environment
*/
default Environment addPackage(Package pkg) {
addPackage(pkg.getName());
return this;
}
代码示例来源:origin: io.micronaut/inject
/**
* Add an application package. Application packages are candidates for scanning for tools that need it (such as JPA
* or GORM).
*
* @param pkg The package to add
* @return This environment
*/
default Environment addPackage(Package pkg) {
addPackage(pkg.getName());
return this;
}
代码示例来源:origin: io.micronaut/inject
if (!packages.isEmpty()) {
for (String aPackage : packages) {
environment.addPackage(aPackage);
代码示例来源:origin: io.micronaut/micronaut-inject
if (!packages.isEmpty()) {
for (String aPackage : packages) {
environment.addPackage(aPackage);
内容来源于网络,如有侵权,请联系作者删除!