c

play.api.inject.guice

GuiceApplicationBuilder

final case class GuiceApplicationBuilder(environment: Environment = Environment.simple(), configuration: Configuration = Configuration.empty, modules: Seq[GuiceableModule] = Seq.empty, overrides: Seq[GuiceableModule] = Seq.empty, disabled: Seq[Class[_]] = Seq.empty, binderOptions: Set[BinderOption] = BinderOption.defaults, eagerly: Boolean = false, loadConfiguration: (Environment) => Configuration = Configuration.load, loadModules: (Environment, Configuration) => Seq[GuiceableModule] = GuiceableModule.loadModules) extends GuiceBuilder[GuiceApplicationBuilder] with Product with Serializable

A builder for creating Applications using Guice.

Source
GuiceApplicationBuilder.scala
Linear Supertypes
Serializable, Product, Equals, GuiceBuilder[GuiceApplicationBuilder], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GuiceApplicationBuilder
  2. Serializable
  3. Product
  4. Equals
  5. GuiceBuilder
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new GuiceApplicationBuilder()
  2. new GuiceApplicationBuilder(environment: Environment = Environment.simple(), configuration: Configuration = Configuration.empty, modules: Seq[GuiceableModule] = Seq.empty, overrides: Seq[GuiceableModule] = Seq.empty, disabled: Seq[Class[_]] = Seq.empty, binderOptions: Set[BinderOption] = BinderOption.defaults, eagerly: Boolean = false, loadConfiguration: () => Configuration = Configuration.load, loadModules: (, Configuration) => Seq[GuiceableModule] = GuiceableModule.loadModules)

Value Members

  1. def additionalRouter(router: Router): GuiceApplicationBuilder

    Override the router with a router that first tries to route to the passed in additional router, before falling back to the default router.

  2. def appRoutes(routes: (Application) => PartialFunction[(String, String), Handler]): GuiceApplicationBuilder

    Override the router with a fake router having the given routes, before falling back to the default router

  3. def applicationModule(): com.google.inject.Module

    Create a new Play application Module for an Application using this configured builder.

    Create a new Play application Module for an Application using this configured builder.

    Definition Classes
    GuiceBuilder
  4. val binderOptions: Set[BinderOption]
  5. final def bindings(bindModules: GuiceableModule*): GuiceApplicationBuilder

    Add Guice modules, Play modules, or Play bindings.

    Add Guice modules, Play modules, or Play bindings.

    Definition Classes
    GuiceBuilder
    See also

    for the automatically available implicit conversions to GuiceableModule from modules and bindings.

  6. def build(): Application

    Create a new Play Application using this configured builder.

  7. val configuration: Configuration
  8. final def configure(conf: (String, Any)*): GuiceApplicationBuilder

    Add additional configuration.

    Add additional configuration.

    Definition Classes
    GuiceBuilder
  9. final def configure(conf: Map[String, Any]): GuiceApplicationBuilder

    Add additional configuration.

    Add additional configuration.

    Definition Classes
    GuiceBuilder
  10. final def configure(conf: Configuration): GuiceApplicationBuilder

    Add additional configuration.

    Add additional configuration.

    Definition Classes
    GuiceBuilder
  11. def configureLoggerFactory(configuration: Configuration): ILoggerFactory

    Configures the SLF4J logger factory.

    Configures the SLF4J logger factory. This is where LoggerConfigurator is called from.

    configuration

    play.api.Configuration

    returns

    the app wide ILoggerFactory. Useful for testing and DI.

  12. def createModule(): com.google.inject.Module

    Creation of the Guice Module used by the injector.

    Creation of the Guice Module used by the injector. Libraries like Guiceberry and Jukito that want to handle injector creation may find this helpful.

    Definition Classes
    GuiceBuilder
  13. final def disable[T](implicit tag: ClassTag[T]): GuiceApplicationBuilder

    Disable module by class.

    Disable module by class.

    Definition Classes
    GuiceBuilder
  14. final def disable(moduleClasses: Class[_]*): GuiceApplicationBuilder

    Disable modules by class.

    Disable modules by class.

    Definition Classes
    GuiceBuilder
  15. final def disableCircularProxies(disable: Boolean = true): GuiceApplicationBuilder

    Disable circular proxies on the Guice Binder.

    Disable circular proxies on the Guice Binder. Without this option, Guice will try to proxy interfaces/traits to break a circular dependency.

    Circular proxies are disabled by default. Use disableCircularProxies(false) to allow circular proxies.

    Definition Classes
    GuiceBuilder
  16. val disabled: Seq[Class[_]]
  17. val eagerly: Boolean
  18. final def eagerlyLoaded(): GuiceApplicationBuilder

    Set the dependency initialization to eager.

    Set the dependency initialization to eager.

    Definition Classes
    GuiceBuilder
  19. val environment: Environment
  20. def globalApp(enabled: Boolean): GuiceApplicationBuilder

    Sets the configuration key to enable/disable global application state

  21. final def in(classLoader: ClassLoader): GuiceApplicationBuilder

    Set the environment class loader.

    Set the environment class loader.

    Definition Classes
    GuiceBuilder
  22. final def in(mode: Mode): GuiceApplicationBuilder

    Set the environment mode.

    Set the environment mode.

    Definition Classes
    GuiceBuilder
  23. final def in(path: File): GuiceApplicationBuilder

    Set the environment path.

    Set the environment path.

    Definition Classes
    GuiceBuilder
  24. final def in(env: Environment): GuiceApplicationBuilder

    Set the environment.

    Set the environment.

    Definition Classes
    GuiceBuilder
  25. def injector(): Injector

    Create a Play Injector backed by Guice using this configured builder.

    Create a Play Injector backed by Guice using this configured builder.

    Definition Classes
    GuiceBuilder
  26. def load(modules: GuiceableModule*): GuiceApplicationBuilder

    Override the module loader with the given modules.

  27. def load(loader: (, Configuration) => Seq[GuiceableModule]): GuiceApplicationBuilder

    Set the module loader.

    Set the module loader. Overrides the default or any previously configured values.

  28. def loadConfig(conf: Configuration): GuiceApplicationBuilder

    Set the initial configuration.

    Set the initial configuration. Overrides the default or any previously configured values.

  29. def loadConfig(loader: () => Configuration): GuiceApplicationBuilder

    Set the initial configuration loader.

    Set the initial configuration loader. Overrides the default or any previously configured values.

  30. val loadConfiguration: () => Configuration
  31. val loadModules: (, Configuration) => Seq[GuiceableModule]
  32. val modules: Seq[GuiceableModule]
  33. final def overrides(overrideModules: GuiceableModule*): GuiceApplicationBuilder

    Override bindings using Guice modules, Play modules, or Play bindings.

    Override bindings using Guice modules, Play modules, or Play bindings.

    Definition Classes
    GuiceBuilder
    See also

    for the automatically available implicit conversions to GuiceableModule from modules and bindings.

  34. val overrides: Seq[GuiceableModule]
  35. def productElementNames: Iterator[String]
    Definition Classes
    Product
  36. def registerExceptionHandlers(): Unit
  37. final def requireAtInjectOnConstructors(require: Boolean = true): GuiceApplicationBuilder

    Require @Inject on constructors (even default constructors).

    Require @Inject on constructors (even default constructors).

    This option is disabled by default.

    Definition Classes
    GuiceBuilder
  38. final def requireExactBindingAnnotations(require: Boolean = true): GuiceApplicationBuilder

    Requires that Guice finds an exactly matching binding annotation.

    Requires that Guice finds an exactly matching binding annotation.

    Disables the error-prone feature in Guice where it can substitute a binding for @Named Foo when injecting @Named("foo") Foo.

    This option is disabled by default.

    Definition Classes
    GuiceBuilder
  39. final def requireExplicitBindings(require: Boolean = true): GuiceApplicationBuilder

    Instructs the injector to only inject classes that are explicitly bound in a module.

    Instructs the injector to only inject classes that are explicitly bound in a module.

    This option is disabled by default.

    Definition Classes
    GuiceBuilder
  40. def router(router: Router): GuiceApplicationBuilder

    Override the router with the given router.

  41. def routes(routesFunc: PartialFunction[(String, String), Handler]): GuiceApplicationBuilder
  42. def shouldDisplayLoggerDeprecationMessage(appConfiguration: Configuration): Boolean

    Checks if the path contains the logger path and whether or not one of the keys contains a deprecated value

    Checks if the path contains the logger path and whether or not one of the keys contains a deprecated value

    appConfiguration

    The app configuration

    returns

    Returns true if one of the keys contains a deprecated value, otherwise false