play.Environment.<init>()方法的使用及代码示例

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

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

Environment.<init>介绍

暂无

代码示例

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

  1. /**
  2. * A simple environment.
  3. *
  4. * Uses the same classloader that the environment classloader is defined in,
  5. * the current working directory as the path and test mode.
  6. *
  7. * @return the environment
  8. */
  9. public static Environment simple() {
  10. return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
  11. }

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

  1. /**
  2. * A simple environment.
  3. *
  4. * Uses the same classloader that the environment classloader is defined in,
  5. * the current working directory as the path and test mode.
  6. *
  7. * @return the environment
  8. */
  9. public static Environment simple() {
  10. return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
  11. }

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

  1. /**
  2. * A simple environment.
  3. *
  4. * Uses the same classloader that the environment classloader is defined in,
  5. * the current working directory as the path and test mode.
  6. */
  7. public static Environment simple() {
  8. return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
  9. }

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

  1. /**
  2. * A simple environment.
  3. *
  4. * Uses the same classloader that the environment classloader is defined in,
  5. * the current working directory as the path and test mode.
  6. *
  7. * @return the environment
  8. */
  9. public static Environment simple() {
  10. return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
  11. }

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

  1. /**
  2. * Get the environment from the context.
  3. *
  4. * @return the environment
  5. */
  6. public Environment environment() {
  7. return new Environment(underlying.environment());
  8. }

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

  1. /**
  2. * Get the environment from the context.
  3. *
  4. * @return the environment
  5. */
  6. public Environment environment() {
  7. return new Environment(underlying.environment());
  8. }

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

  1. /**
  2. * Get the environment from the context.
  3. */
  4. public Environment environment() {
  5. return new Environment(underlying.environment());
  6. }

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

  1. /**
  2. * Get the environment from the context.
  3. *
  4. * @return the environment
  5. */
  6. public Environment environment() {
  7. return new Environment(underlying.environment());
  8. }

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

  1. /**
  2. * Create an application that wraps a Scala application.
  3. *
  4. * @param application the application to wrap
  5. * @param config the new application's configuration
  6. * @param injector the new application's injector
  7. *
  8. * @deprecated Use {@link #DefaultApplication(play.api.Application, Config, Injector, Environment)} instead.
  9. */
  10. @Deprecated
  11. public DefaultApplication(play.api.Application application, Config config, Injector injector) {
  12. this(application, config, injector, new Environment(application.environment()));
  13. }

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

  1. /**
  2. * Create an application that wraps a Scala application.
  3. *
  4. * @param application the application to wrap
  5. * @param config the new application's configuration
  6. * @param injector the new application's injector
  7. *
  8. * @deprecated Use {@link #DefaultApplication(play.api.Application, Config, Injector, Environment)} instead.
  9. */
  10. @Deprecated
  11. public DefaultApplication(play.api.Application application, Config config, Injector injector) {
  12. this(application, config, injector, new Environment(application.environment()));
  13. }

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

  1. /**
  2. * Create an application that wraps a Scala application.
  3. *
  4. * @param application the application to wrap
  5. * @param config the new application's configuration
  6. * @param injector the new application's injector
  7. *
  8. * @deprecated Use {@link #DefaultApplication(play.api.Application, Config, Injector, Environment)} instead.
  9. */
  10. @Deprecated
  11. public DefaultApplication(play.api.Application application, Config config, Injector injector) {
  12. this(application, config, injector, new Environment(application.environment()));
  13. }

代码示例来源:origin: com.typesafe.play/play-guice_2.11

  1. /**
  2. * Set the initial configuration loader.
  3. * Overrides the default or any previously configured values.
  4. *
  5. * @param load the configuration loader
  6. * @return the configured application builder
  7. */
  8. public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
  9. return newBuilder(delegate.loadConfig(func((play.api.Environment env) ->
  10. new play.api.Configuration(load.apply(new Environment(env))))));
  11. }

代码示例来源:origin: com.typesafe.play/play-guice_2.12

  1. /**
  2. * Set the initial configuration loader.
  3. * Overrides the default or any previously configured values.
  4. *
  5. * @param load the configuration loader
  6. * @return the configured application builder
  7. */
  8. public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
  9. return newBuilder(delegate.loadConfig(func((play.api.Environment env) ->
  10. new play.api.Configuration(load.apply(new Environment(env))))));
  11. }

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

  1. @Override
  2. public Map<String, List<String>> apply(ClassLoader classLoader) {
  3. // Using TEST mode is the only way to load configuration without failing if application.conf doesn't exist
  4. Environment env = new Environment(new File("."), classLoader, Mode.TEST);
  5. Config config = ConfigFactory.load(env.classLoader());
  6. return EbeanParsedConfig.parseFromConfig(config).getDatasourceModels();
  7. }
  8. }

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

  1. /**
  2. * Set the initial configuration loader.
  3. * Overrides the default or any previously configured values.
  4. */
  5. public GuiceApplicationBuilder loadConfig(Function<Environment, Configuration> load) {
  6. return newBuilder(delegate.loadConfig(func((play.api.Environment env) -> load.apply(new Environment(env)).getWrappedConfiguration())));
  7. }

代码示例来源:origin: com.typesafe.play/play-guice_2.11

  1. /**
  2. * Set the module loader.
  3. * Overrides the default or any previously configured values.
  4. *
  5. * @param loader the configuration
  6. * @return the configured application builder
  7. */
  8. public GuiceApplicationBuilder withModuleLoader(BiFunction<Environment, Config, List<GuiceableModule>> loader) {
  9. return newBuilder(delegate.load(func((play.api.Environment env, play.api.Configuration conf) ->
  10. Scala.toSeq(loader.apply(new Environment(env), conf.underlying()))
  11. )));
  12. }

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

  1. /**
  2. * Set the module loader.
  3. * Overrides the default or any previously configured values.
  4. */
  5. public GuiceApplicationBuilder load(BiFunction<Environment, Configuration, List<GuiceableModule>> loader) {
  6. return newBuilder(delegate.load(func((play.api.Environment env, play.api.Configuration conf) ->
  7. Scala.toSeq(loader.apply(new Environment(env), new Configuration(conf)))
  8. )));
  9. }

代码示例来源:origin: com.typesafe.play/play-guice_2.12

  1. /**
  2. * Set the module loader.
  3. * Overrides the default or any previously configured values.
  4. *
  5. * @param loader the configuration
  6. * @return the configured application builder
  7. */
  8. public GuiceApplicationBuilder withModuleLoader(BiFunction<Environment, Config, List<GuiceableModule>> loader) {
  9. return newBuilder(delegate.load(func((play.api.Environment env, play.api.Configuration conf) ->
  10. Scala.toSeq(loader.apply(new Environment(env), conf.underlying()))
  11. )));
  12. }

相关文章