/** * Returns the underlying Typesafe config object. * * @return The config */ public Config underlying() { return conf.underlying(); }
/** * Returns the config as a set of full paths to config values. This is * different to {@link asMap()} in that it returns {@link com.typesafe.config.ConfigValue} * objects, and keys are recursively expanded to be pull path keys. * * @return The config as an entry set */ public Set<Map.Entry<String, ConfigValue>> entrySet() { return conf.underlying().entrySet(); }
/** * Create an application that wraps a Scala application. * * @param application the application to wrap * @param injector the new application's injector */ public DefaultApplication(play.api.Application application, Injector injector) { this(application, application.configuration().underlying(), injector); }
/** * Create an application that wraps a Scala application. * * @param application the application to wrap * @param injector the new application's injector */ public DefaultApplication(play.api.Application application, Injector injector) { this(application, application.configuration().underlying(), injector); }
/** * Create an application that wraps a Scala application. * * @param application the application to wrap * @param injector the new application's injector */ public DefaultApplication(play.api.Application application, Injector injector) { this(application, application.configuration().underlying(), injector); }
/** * Get the configuration from the context. This configuration is not necessarily the same * configuration used by the application, as the ApplicationLoader may, through it's own * mechanisms, modify it or completely ignore it. * * @return the initial configuration */ public Config initialConfig() { return underlying.initialConfiguration().underlying(); }
/** * Get the configuration from the context. This configuration is not necessarily the same * configuration used by the application, as the ApplicationLoader may, through it's own * mechanisms, modify it or completely ignore it. * * @return the initial configuration */ public Config initialConfig() { return underlying.initialConfiguration().underlying(); }
/** * Get the configuration from the context. This configuration is not necessarily the same * configuration used by the application, as the ApplicationLoader may, through it's own * mechanisms, modify it or completely ignore it. * * @return the initial configuration */ public Config initialConfig() { return underlying.initialConfiguration().underlying(); }
private static Config config() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Properties properties = System.getProperties(); scala.collection.immutable.Map<String, Object> directSettings = scala.collection.immutable.Map$.MODULE$.empty(); // We are allowing missing application conf because it can handle both cases. boolean allowMissingApplicationConf = true; // Using play.api.Configuration.load because it is more consistent with how the // actual configuration is loaded for the application. return play.api.Configuration.load(classLoader, properties, directSettings, allowMissingApplicationConf).underlying(); }
private static Config config() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Properties properties = System.getProperties(); scala.collection.immutable.Map<String, Object> directSettings = scala.collection.immutable.Map$.MODULE$.empty(); // We are allowing missing application conf because it can handle both cases. boolean allowMissingApplicationConf = true; // Using play.api.Configuration.load because it is more consistent with how the // actual configuration is loaded for the application. return play.api.Configuration.load(classLoader, properties, directSettings, allowMissingApplicationConf).underlying(); }
private static Config config() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Properties properties = System.getProperties(); scala.collection.immutable.Map<String, Object> directSettings = scala.collection.immutable.Map$.MODULE$.empty(); // We are allowing missing application conf because it can handle both cases. boolean allowMissingApplicationConf = true; // Using play.api.Configuration.load because it is more consistent with how the // actual configuration is loaded for the application. return play.api.Configuration.load(classLoader, properties, directSettings, allowMissingApplicationConf).underlying(); }
/** * Returns the config as a map of plain old Java maps, lists and values. * * @return The config map */ public Map<String, Object> asMap() { return conf.underlying().root().unwrapped(); }
@Override public final Seq<play.api.inject.Binding<?>> bindings(final play.api.Environment environment, final play.api.Configuration configuration) { List<play.api.inject.Binding<?>> list = bindings(environment.asJava(), configuration.underlying()).stream() .map(Binding::asScala) .collect(Collectors.toList()); return JavaConverters.collectionAsScalaIterableConverter(list).asScala().toList(); }
@Override public final Seq<play.api.inject.Binding<?>> bindings(final play.api.Environment environment, final play.api.Configuration configuration) { List<play.api.inject.Binding<?>> list = bindings(environment.asJava(), configuration.underlying()).stream() .map(Binding::asScala) .collect(Collectors.toList()); return JavaConverters.collectionAsScalaIterableConverter(list).asScala().toList(); }
@Override public final Seq<play.api.inject.Binding<?>> bindings(final play.api.Environment environment, final play.api.Configuration configuration) { List<play.api.inject.Binding<?>> list = bindings(environment.asJava(), configuration.underlying()).stream() .map(Binding::asScala) .collect(Collectors.toList()); return JavaConverters.collectionAsScalaIterableConverter(list).asScala().toList(); }
@Override default void configure(play.api.Environment env, Configuration configuration, scala.collection.immutable.Map<String, String> optionalProperties) { configure( env.asJava(), configuration.underlying(), Scala.asJava(optionalProperties) ); }
@Override default void configure(play.api.Environment env, Configuration configuration, scala.collection.immutable.Map<String, String> optionalProperties) { configure( env.asJava(), configuration.underlying(), Scala.asJava(optionalProperties) ); }
@Override default void configure(play.api.Environment env, Configuration configuration, scala.collection.immutable.Map<String, String> optionalProperties) { configure( env.asJava(), configuration.underlying(), Scala.asJava(optionalProperties) ); }
/** * 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())) ))); }
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()); }