本文整理了Java中play.Environment.<init>()
方法的一些代码示例,展示了Environment.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.<init>()
方法的具体详情如下:
包路径:play.Environment
类名称:Environment
方法名:<init>
暂无
代码示例来源:origin: com.typesafe.play/play
/**
* A simple environment.
*
* Uses the same classloader that the environment classloader is defined in,
* the current working directory as the path and test mode.
*
* @return the environment
*/
public static Environment simple() {
return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* A simple environment.
*
* Uses the same classloader that the environment classloader is defined in,
* the current working directory as the path and test mode.
*
* @return the environment
*/
public static Environment simple() {
return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* A simple environment.
*
* Uses the same classloader that the environment classloader is defined in,
* the current working directory as the path and test mode.
*/
public static Environment simple() {
return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* A simple environment.
*
* Uses the same classloader that the environment classloader is defined in,
* the current working directory as the path and test mode.
*
* @return the environment
*/
public static Environment simple() {
return new Environment(new File("."), Environment.class.getClassLoader(), Mode.TEST);
}
代码示例来源:origin: com.typesafe.play/play
/**
* Get the environment from the context.
*
* @return the environment
*/
public Environment environment() {
return new Environment(underlying.environment());
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Get the environment from the context.
*
* @return the environment
*/
public Environment environment() {
return new Environment(underlying.environment());
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get the environment from the context.
*/
public Environment environment() {
return new Environment(underlying.environment());
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* Get the environment from the context.
*
* @return the environment
*/
public Environment environment() {
return new Environment(underlying.environment());
}
代码示例来源:origin: com.typesafe.play/play_2.11
/**
* Create an application that wraps a Scala application.
*
* @param application the application to wrap
* @param config the new application's configuration
* @param injector the new application's injector
*
* @deprecated Use {@link #DefaultApplication(play.api.Application, Config, Injector, Environment)} instead.
*/
@Deprecated
public DefaultApplication(play.api.Application application, Config config, Injector injector) {
this(application, config, injector, new Environment(application.environment()));
}
代码示例来源:origin: com.typesafe.play/play
/**
* Create an application that wraps a Scala application.
*
* @param application the application to wrap
* @param config the new application's configuration
* @param injector the new application's injector
*
* @deprecated Use {@link #DefaultApplication(play.api.Application, Config, Injector, Environment)} instead.
*/
@Deprecated
public DefaultApplication(play.api.Application application, Config config, Injector injector) {
this(application, config, injector, new Environment(application.environment()));
}
代码示例来源:origin: com.typesafe.play/play_2.12
/**
* Create an application that wraps a Scala application.
*
* @param application the application to wrap
* @param config the new application's configuration
* @param injector the new application's injector
*
* @deprecated Use {@link #DefaultApplication(play.api.Application, Config, Injector, Environment)} instead.
*/
@Deprecated
public DefaultApplication(play.api.Application application, Config config, Injector injector) {
this(application, config, injector, new Environment(application.environment()));
}
代码示例来源:origin: com.typesafe.play/play-guice_2.11
/**
* Set the initial configuration loader.
* Overrides the default or any previously configured values.
*
* @param load the configuration loader
* @return the configured application builder
*/
public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
return newBuilder(delegate.loadConfig(func((play.api.Environment env) ->
new play.api.Configuration(load.apply(new Environment(env))))));
}
代码示例来源:origin: com.typesafe.play/play-guice_2.12
/**
* Set the initial configuration loader.
* Overrides the default or any previously configured values.
*
* @param load the configuration loader
* @return the configured application builder
*/
public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) {
return newBuilder(delegate.loadConfig(func((play.api.Environment env) ->
new play.api.Configuration(load.apply(new Environment(env))))));
}
代码示例来源:origin: com.typesafe.play/play-ebean
@Override
public Map<String, List<String>> apply(ClassLoader classLoader) {
// Using TEST mode is the only way to load configuration without failing if application.conf doesn't exist
Environment env = new Environment(new File("."), classLoader, Mode.TEST);
Config config = ConfigFactory.load(env.classLoader());
return EbeanParsedConfig.parseFromConfig(config).getDatasourceModels();
}
}
代码示例来源:origin: com.typesafe.play/play-java_2.10
/**
* Set the initial configuration loader.
* Overrides the default or any previously configured values.
*/
public GuiceApplicationBuilder loadConfig(Function<Environment, Configuration> load) {
return newBuilder(delegate.loadConfig(func((play.api.Environment env) -> load.apply(new Environment(env)).getWrappedConfiguration())));
}
代码示例来源:origin: com.typesafe.play/play-guice_2.11
/**
* Set the module loader.
* Overrides the default or any previously configured values.
*
* @param loader the configuration
* @return the configured application builder
*/
public GuiceApplicationBuilder withModuleLoader(BiFunction<Environment, Config, List<GuiceableModule>> loader) {
return newBuilder(delegate.load(func((play.api.Environment env, play.api.Configuration conf) ->
Scala.toSeq(loader.apply(new Environment(env), conf.underlying()))
)));
}
代码示例来源:origin: com.typesafe.play/play-java_2.10
/**
* Set the module loader.
* Overrides the default or any previously configured values.
*/
public GuiceApplicationBuilder load(BiFunction<Environment, Configuration, List<GuiceableModule>> loader) {
return newBuilder(delegate.load(func((play.api.Environment env, play.api.Configuration conf) ->
Scala.toSeq(loader.apply(new Environment(env), new Configuration(conf)))
)));
}
代码示例来源:origin: com.typesafe.play/play-guice_2.12
/**
* Set the module loader.
* Overrides the default or any previously configured values.
*
* @param loader the configuration
* @return the configured application builder
*/
public GuiceApplicationBuilder withModuleLoader(BiFunction<Environment, Config, List<GuiceableModule>> loader) {
return newBuilder(delegate.load(func((play.api.Environment env, play.api.Configuration conf) ->
Scala.toSeq(loader.apply(new Environment(env), conf.underlying()))
)));
}
内容来源于网络,如有侵权,请联系作者删除!