本文整理了Java中play.Environment.underlying()
方法的一些代码示例,展示了Environment.underlying()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.underlying()
方法的具体详情如下:
包路径:play.Environment
类名称:Environment
方法名:underlying
[英]The underlying Scala API Environment object that this Environment wraps.
[中]此环境包装的底层Scala API环境对象。
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Load a new configuration from an environment.
*/
public static Configuration load(Environment env) {
return new Configuration(play.api.Configuration.load(env.underlying()));
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* The context for loading an application.
*
* @param environment the application environment
* @param initialSettings the initial settings. These settings are merged with the settings from the loaded
* configuration files, and together form the initialConfiguration provided by the context. It
* is intended for use in dev mode, to allow the build system to pass additional configuration
* into the application.
*/
public Context(Environment environment, Map<String,Object> initialSettings) {
this.underlying = new play.api.ApplicationLoader.Context(
environment.underlying(),
scala.Option.empty(),
new play.core.DefaultWebCommands(),
play.api.Configuration.load(environment.underlying(), play.libs.Scala.asScala(initialSettings)));
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Create a new context with a different environment.
*/
public Context withEnvironment(Environment environment) {
play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context(
environment.underlying(),
underlying.sourceMapper(),
underlying.webCommands(),
underlying.initialConfiguration());
return new Context(scalaContext);
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Create an application loading context.
*
* Locates and loads the necessary configuration files for the application.
*
* @param environment The application environment.
* @param initialSettings The initial settings. These settings are merged with the settings from the loaded
* configuration files, and together form the initialConfiguration provided by the context. It
* is intended for use in dev mode, to allow the build system to pass additional configuration
* into the application.
*/
public static Context create(Environment environment, Map<String, Object> initialSettings) {
play.api.ApplicationLoader.Context scalaContext = play.api.ApplicationLoader$.MODULE$.createContext(
environment.underlying(),
Scala.asScala(initialSettings),
Scala.<SourceMapper>None(),
new DefaultWebCommands());
return new Context(scalaContext);
}
代码示例来源:origin: com.typesafe.play/play-java_2.10
/**
* Set the environment.
*/
public final Self in(Environment env) {
return newBuilder(delegate.in(env.underlying()));
}
代码示例来源:origin: com.typesafe.play/play-java-jdbc_2.10
public DataSource create(String name, Configuration configuration, Environment environment) {
PlayConfig config = new PlayConfig(configuration.getWrappedConfiguration().underlying());
return cp.create(name, DatabaseConfig.fromConfig(config, environment.underlying()), config.underlying());
}
内容来源于网络,如有侵权,请联系作者删除!