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 class
Delegate - 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
    Modifier and Type
    Field
    Description
    protected Delegate
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.inject.Module
    Create a Guice module that can be used to inject an Application.
    final Self
    bindings(com.google.inject.Module... modules)
    Add bindings from Guice modules.
    final Self
    bindings(play.api.inject.Binding<?>... bindings)
    Add Play bindings.
    final Self
    bindings(play.api.inject.guice.GuiceableModule... modules)
    Add bindings from guiceable modules.
    final Self
    bindings(play.api.inject.Module... modules)
    Add bindings from Play modules.
    final Self
    configure(com.typesafe.config.Config conf)
    Add additional configuration.
    final Self
    configure(String key, Object value)
    Add additional configuration.
    final Self
    Add additional configuration.
    final Self
    disable(Class<?>... moduleClasses)
    Disable modules by class.
    final Self
    in(File path)
    Set the environment path.
    final Self
    in(ClassLoader classLoader)
    Set the environment class loader.
    final Self
    Set the environment.
    final Self
    in(Mode mode)
    Set the environment mode.
    Create a Play Injector backed by Guice using this configured builder.
    protected abstract Self
    newBuilder(Delegate delegate)
     
    final Self
    overrides(com.google.inject.Module... modules)
    Override bindings using Guice modules.
    final Self
    overrides(play.api.inject.Binding<?>... bindings)
    Override bindings using Play bindings.
    final Self
    overrides(play.api.inject.guice.GuiceableModule... modules)
    Override bindings using guiceable modules.
    final Self
    overrides(play.api.inject.Module... modules)
    Override bindings using Play modules.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • delegate

      protected Delegate extends play.api.inject.guice.GuiceBuilder<Delegate> delegate
  • Constructor Details

    • GuiceBuilder

      protected GuiceBuilder(Delegate delegate)
  • Method Details

    • in

      public final Self in(Environment env)
      Set the environment.
      Parameters:
      env - the environment to configure into this application
      Returns:
      a copy of this builder with the new environment
    • in

      public final Self in(File path)
      Set the environment path.
      Parameters:
      path - the path to configure
      Returns:
      a copy of this builder with the new path
    • in

      public final Self in(Mode mode)
      Set the environment mode.
      Parameters:
      mode - the mode to configure
      Returns:
      a copy of this build configured with this mode
    • in

      public final Self in(ClassLoader classLoader)
      Set the environment class loader.
      Parameters:
      classLoader - the class loader to use
      Returns:
      a copy of this builder configured with the class loader
    • configure

      public final Self configure(com.typesafe.config.Config conf)
      Add additional configuration.
      Parameters:
      conf - the configuration to add
      Returns:
      a copy of this builder configured with the supplied configuration
    • configure

      public final Self configure(Map<String,Object> conf)
      Add additional configuration.
      Parameters:
      conf - the configuration to add
      Returns:
      a copy of this builder configured with the supplied configuration
    • configure

      public final Self configure(String key, Object value)
      Add additional configuration.
      Parameters:
      key - a configuration key to set
      value - the associated value for key
      Returns:
      a copy of this builder configured with the key=value
    • bindings

      public final Self bindings(play.api.inject.guice.GuiceableModule... modules)
      Add bindings from guiceable modules.
      Parameters:
      modules - the set of modules to bind
      Returns:
      a copy of this builder configured with those modules
    • bindings

      public final Self bindings(com.google.inject.Module... modules)
      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

      public final Self bindings(play.api.inject.Module... modules)
      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

      public final Self bindings(play.api.inject.Binding<?>... 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

      public final Self overrides(play.api.inject.guice.GuiceableModule... modules)
      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

      public final Self overrides(com.google.inject.Module... modules)
      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

      public final Self overrides(play.api.inject.Module... modules)
      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

      public final Self overrides(play.api.inject.Binding<?>... bindings)
      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

      public final Self disable(Class<?>... moduleClasses)
      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

      public Injector injector()
      Create a Play Injector backed by Guice using this configured builder.
      Returns:
      the injector
    • newBuilder

      protected abstract Self newBuilder(Delegate delegate)