play.Environment.underlying()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中play.Environment.underlying()方法的一些代码示例,展示了Environment.underlying()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.underlying()方法的具体详情如下:
包路径:play.Environment
类名称:Environment
方法名:underlying

Environment.underlying介绍

[英]The underlying Scala API Environment object that this Environment wraps.
[中]此环境包装的底层Scala API环境对象。

代码示例

代码示例来源:origin: com.typesafe.play/play_2.10

  1. /**
  2. * Load a new configuration from an environment.
  3. */
  4. public static Configuration load(Environment env) {
  5. return new Configuration(play.api.Configuration.load(env.underlying()));
  6. }

代码示例来源:origin: com.typesafe.play/play_2.10

  1. /**
  2. * The context for loading an application.
  3. *
  4. * @param environment the application environment
  5. * @param initialSettings the initial settings. These settings are merged with the settings from the loaded
  6. * configuration files, and together form the initialConfiguration provided by the context. It
  7. * is intended for use in dev mode, to allow the build system to pass additional configuration
  8. * into the application.
  9. */
  10. public Context(Environment environment, Map<String,Object> initialSettings) {
  11. this.underlying = new play.api.ApplicationLoader.Context(
  12. environment.underlying(),
  13. scala.Option.empty(),
  14. new play.core.DefaultWebCommands(),
  15. play.api.Configuration.load(environment.underlying(), play.libs.Scala.asScala(initialSettings)));
  16. }

代码示例来源:origin: com.typesafe.play/play_2.10

  1. /**
  2. * Create a new context with a different environment.
  3. */
  4. public Context withEnvironment(Environment environment) {
  5. play.api.ApplicationLoader.Context scalaContext = new play.api.ApplicationLoader.Context(
  6. environment.underlying(),
  7. underlying.sourceMapper(),
  8. underlying.webCommands(),
  9. underlying.initialConfiguration());
  10. return new Context(scalaContext);
  11. }

代码示例来源:origin: com.typesafe.play/play_2.10

  1. /**
  2. * Create an application loading context.
  3. *
  4. * Locates and loads the necessary configuration files for the application.
  5. *
  6. * @param environment The application environment.
  7. * @param initialSettings The initial settings. These settings are merged with the settings from the loaded
  8. * configuration files, and together form the initialConfiguration provided by the context. It
  9. * is intended for use in dev mode, to allow the build system to pass additional configuration
  10. * into the application.
  11. */
  12. public static Context create(Environment environment, Map<String, Object> initialSettings) {
  13. play.api.ApplicationLoader.Context scalaContext = play.api.ApplicationLoader$.MODULE$.createContext(
  14. environment.underlying(),
  15. Scala.asScala(initialSettings),
  16. Scala.<SourceMapper>None(),
  17. new DefaultWebCommands());
  18. return new Context(scalaContext);
  19. }

代码示例来源:origin: com.typesafe.play/play-java_2.10

  1. /**
  2. * Set the environment.
  3. */
  4. public final Self in(Environment env) {
  5. return newBuilder(delegate.in(env.underlying()));
  6. }

代码示例来源:origin: com.typesafe.play/play-java-jdbc_2.10

  1. public DataSource create(String name, Configuration configuration, Environment environment) {
  2. PlayConfig config = new PlayConfig(configuration.getWrappedConfiguration().underlying());
  3. return cp.create(name, DatabaseConfig.fromConfig(config, environment.underlying()), config.underlying());
  4. }

相关文章