Class Guice4

java.lang.Object
org.eclipse.sisu.inject.Guice4

public final class Guice4 extends Object
Utility methods for dealing with changes in the Guice 4.0 SPI.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final boolean
     
    private static final boolean
     
    private static final boolean
     
    (package private) static final Object
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Object
    getDeclaringSource(com.google.inject.Binding<?> binding)
    Returns the source that originally declared the given binding.
    static javax.inject.Provider<?>
    getProviderInstance(com.google.inject.spi.ProviderInstanceBinding<?> binding)
    Returns the provider that originally backed the given binding.
    static <T> javax.inject.Provider<T>
    lazy(com.google.inject.Binding<T> binding)
    Returns a lazy provider that only uses the binding once and caches the result.

    Methods inherited from class java.lang.Object

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

    • HAS_DECLARING_SOURCE

      private static final boolean HAS_DECLARING_SOURCE
    • HAS_USER_SUPPLIED_PROVIDER

      private static final boolean HAS_USER_SUPPLIED_PROVIDER
    • HAS_OLD_SCOPES_SINGLETON

      private static final boolean HAS_OLD_SCOPES_SINGLETON
    • NIL

      static final Object NIL
  • Constructor Details

    • Guice4

      private Guice4()
  • Method Details

    • getDeclaringSource

      public static Object getDeclaringSource(com.google.inject.Binding<?> binding)
      Returns the source that originally declared the given binding.
      Parameters:
      binding - The binding
      Returns:
      Declaring source; null if it doesn't exist
    • getProviderInstance

      public static javax.inject.Provider<?> getProviderInstance(com.google.inject.spi.ProviderInstanceBinding<?> binding)
      Returns the provider that originally backed the given binding.
      Parameters:
      binding - The binding
      Returns:
      Provider instance
    • lazy

      public static <T> javax.inject.Provider<T> lazy(com.google.inject.Binding<T> binding)
      Returns a lazy provider that only uses the binding once and caches the result.
      Parameters:
      binding - The binding
      Returns:
      Lazy caching provider