Interface ScopeBuilder

All Known Subinterfaces:
BindingBuilder<T>, MapBuilder<K,V>, SetBuilder<T>
All Known Implementing Classes:
DICollectionBuilder

public interface ScopeBuilder
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    in(Scope scope)
    Sets the scope of a bound instance.
    void
    Marks this injection point to be triggered early without explicit call to Injector.getInstance(Class).
    void
    Sets the scope of a bound instance to singleton.
    void
    Sets the scope of a bound instance to "no scope".
  • Method Details

    • in

      void in(Scope scope)
      Sets the scope of a bound instance. This method is used to change the default scope which is a singleton by default to a custom scope.
    • inSingletonScope

      void inSingletonScope()
      Sets the scope of a bound instance to singleton. Singleton is normally the default.
    • withoutScope

      void withoutScope()
      Sets the scope of a bound instance to "no scope". This means that a new instance of an object will be created on every call to Injector.getInstance(Class) or to Provider of this instance.
    • initOnStartup

      void initOnStartup()
      Marks this injection point to be triggered early without explicit call to Injector.getInstance(Class). Such service will be created right after Injector is fully setup. NOTE: use with caution, as this will effectively create all graph of services that this service depends on.