Class GuiceBuilder<Self,​Delegate extends play.api.inject.guice.GuiceBuilder<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 Detail

      • delegate

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

      • GuiceBuilder

        protected GuiceBuilder​(Delegate delegate)
    • Method Detail

      • 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)