Package play.inject.guice
Class GuiceBuilder<Self,Delegate extends play.api.inject.guice.GuiceBuilder<Delegate>>
java.lang.Object
play.inject.guice.GuiceBuilder<Self,Delegate>
- Type Parameters:
Self- the concrete type that is extending this classDelegate- a scala GuiceBuilder type.
- Direct Known Subclasses:
GuiceApplicationBuilder,GuiceInjectorBuilder
public abstract class GuiceBuilder<Self,Delegate extends play.api.inject.guice.GuiceBuilder<Delegate>>
extends Object
A builder for creating Guice-backed Play Injectors.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.inject.ModuleCreate a Guice module that can be used to inject an Application.final Selfbindings(com.google.inject.Module... modules) Add bindings from Guice modules.final Selfbindings(play.api.inject.Binding<?>... bindings) Add Play bindings.final Selfbindings(play.api.inject.guice.GuiceableModule... modules) Add bindings from guiceable modules.final Selfbindings(play.api.inject.Module... modules) Add bindings from Play modules.final Selfconfigure(com.typesafe.config.Config conf) Add additional configuration.final SelfAdd additional configuration.final SelfAdd additional configuration.final SelfDisable modules by class.final SelfSet the environment path.final Selfin(ClassLoader classLoader) Set the environment class loader.final Selfin(Environment env) Set the environment.final SelfSet the environment mode.injector()Create a Play Injector backed by Guice using this configured builder.protected abstract SelfnewBuilder(Delegate delegate) final Selfoverrides(com.google.inject.Module... modules) Override bindings using Guice modules.final Selfoverrides(play.api.inject.Binding<?>... bindings) Override bindings using Play bindings.final Selfoverrides(play.api.inject.guice.GuiceableModule... modules) Override bindings using guiceable modules.final Selfoverrides(play.api.inject.Module... modules) Override bindings using Play modules.
-
Field Details
-
delegate
-
-
Constructor Details
-
GuiceBuilder
-
-
Method Details
-
in
Set the environment.- Parameters:
env- the environment to configure into this application- Returns:
- a copy of this builder with the new environment
-
in
Set the environment path.- Parameters:
path- the path to configure- Returns:
- a copy of this builder with the new path
-
in
Set the environment mode.- Parameters:
mode- the mode to configure- Returns:
- a copy of this build configured with this mode
-
in
Set the environment class loader.- Parameters:
classLoader- the class loader to use- Returns:
- a copy of this builder configured with the class loader
-
configure
Add additional configuration.- Parameters:
conf- the configuration to add- Returns:
- a copy of this builder configured with the supplied configuration
-
configure
Add additional configuration.- Parameters:
conf- the configuration to add- Returns:
- a copy of this builder configured with the supplied configuration
-
configure
Add additional configuration.- Parameters:
key- a configuration key to setvalue- the associated value forkey- Returns:
- a copy of this builder configured with the key=value
-
bindings
Add bindings from guiceable modules.- Parameters:
modules- the set of modules to bind- Returns:
- a copy of this builder configured with those modules
-
bindings
Add bindings from Guice modules.- Parameters:
modules- the set of Guice modules whose bindings to apply- Returns:
- a copy of this builder configured with the provided bindings
-
bindings
Add bindings from Play modules.- Parameters:
modules- the set of Guice modules whose bindings to apply- Returns:
- a copy of this builder configured with the provided bindings
-
bindings
Add Play bindings.- Parameters:
bindings- the set of play bindings to apply- Returns:
- a copy of this builder configured with the provided bindings
-
overrides
Override bindings using guiceable modules.- Parameters:
modules- the set of Guice modules whose bindings override some previously configured ones- Returns:
- a copy of this builder re-configured with the provided bindings
-
overrides
Override bindings using Guice modules.- Parameters:
modules- the set of Guice modules whose bindings override some previously configured ones- Returns:
- a copy of this builder re-configured with the provided bindings
-
overrides
Override bindings using Play modules.- Parameters:
modules- the set of Play modules whose bindings override some previously configured ones- Returns:
- a copy of this builder re-configured with the provided bindings
-
overrides
Override bindings using Play bindings.- Parameters:
bindings- a set of Play bindings that override some previously configured ones- Returns:
- a copy of this builder re-configured with the provided bindings
-
disable
Disable modules by class.- Parameters:
moduleClasses- the module classes whose bindings should be disabled- Returns:
- a copy of this builder configured to ignore the provided module classes
-
applicationModule
public com.google.inject.Module applicationModule()Create a Guice module that can be used to inject an Application.- Returns:
- the module
-
injector
Create a Play Injector backed by Guice using this configured builder.- Returns:
- the injector
-
newBuilder
-