GuiceBuilder

play.api.inject.guice.GuiceBuilder
abstract class GuiceBuilder[Self](environment: Environment, configuration: Configuration, modules: Seq[GuiceableModule], overrides: Seq[GuiceableModule], disabled: Seq[Class[_]], binderOptions: Set[BinderOption], eagerly: Boolean)

A builder for creating Guice-backed Play Injectors.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

protected def newBuilder(environment: Environment, configuration: Configuration, modules: Seq[GuiceableModule], overrides: Seq[GuiceableModule], disabled: Seq[Class[_]], binderOptions: Set[BinderOption], eagerly: Boolean): Self

Create a new Self for this immutable builder. Provided by builder implementations.

Create a new Self for this immutable builder. Provided by builder implementations.

Attributes

Concrete methods

def applicationModule(): Module

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

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

Attributes

final def bindings(bindModules: GuiceableModule*): Self

Add Guice modules, Play modules, or Play bindings.

Add Guice modules, Play modules, or Play bindings.

Attributes

See also

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

final def configure(conf: Configuration): Self

Add additional configuration.

Add additional configuration.

Attributes

final def configure(conf: Map[String, Any]): Self

Add additional configuration.

Add additional configuration.

Attributes

final def configure(conf: (String, Any)*): Self

Add additional configuration.

Add additional configuration.

Attributes

def createModule(): Module

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

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

Attributes

final def disable(moduleClasses: Class[_]*): Self

Disable modules by class.

Disable modules by class.

Attributes

final def disable[T](implicit tag: ClassTag[T]): Self

Disable module by class.

Disable module by class.

Attributes

final def disableCircularProxies(disable: Boolean): Self

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

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.

Attributes

final def eagerlyLoaded(): Self

Set the dependency initialization to eager.

Set the dependency initialization to eager.

Attributes

final def in(env: Environment): Self

Set the environment.

Set the environment.

Attributes

final def in(path: File): Self

Set the environment path.

Set the environment path.

Attributes

final def in(mode: Mode): Self

Set the environment mode.

Set the environment mode.

Attributes

final def in(classLoader: ClassLoader): Self

Set the environment class loader.

Set the environment class loader.

Attributes

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

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

Attributes

final def overrides(overrideModules: GuiceableModule*): Self

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

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

Attributes

See also

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

final def requireAtInjectOnConstructors(require: Boolean): Self

Require @Inject on constructors (even default constructors).

Require @Inject on constructors (even default constructors).

This option is disabled by default.

Attributes

final def requireExactBindingAnnotations(require: Boolean): Self

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.``

Attributes

final def requireExplicitBindings(require: Boolean): Self

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.

Attributes