Class Parameter

java.lang.Object
com.google.inject.assistedinject.Parameter

class Parameter extends Object
Models a method or constructor parameter.
  • Field Details

    • type

      private final Type type
    • isAssisted

      private final boolean isAssisted
    • bindingAnnotation

      private final Annotation bindingAnnotation
    • isProvider

      private final boolean isProvider
    • provider

      private volatile Provider<? extends Object> provider
  • Constructor Details

  • Method Details

    • isProvidedByFactory

      public boolean isProvidedByFactory()
    • getType

      public Type getType()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasAssistedAnnotation

      private boolean hasAssistedAnnotation(Annotation[] annotations)
    • getValue

      public Object getValue(Injector injector)
      Returns the Guice Key for this parameter.
    • isBound

      public boolean isBound(Injector injector)
    • isBound

      private boolean isBound(Injector injector, Key<?> key)
    • fixAnnotations

      public Key<?> fixAnnotations(Key<?> key)
      Replace annotation instances with annotation types, this is only appropriate for testing if a key is bound and not for injecting.

      See Guice bug 125, https://github.com/google/guice/issues/125

    • getPrimaryBindingKey

      Key<?> getPrimaryBindingKey()
    • getProvidedType

      private Type getProvidedType(Type type)
    • isProvider

      private boolean isProvider(Type type)
    • getBindingForType

      private Key<?> getBindingForType(Type type)
    • getBindingAnnotation

      private Annotation getBindingAnnotation(Annotation[] annotations)
      Returns the unique binding annotation from the specified list, or null if there are none.
      Throws:
      IllegalStateException - if multiple binding annotations exist.