Class AbstractBindingBuilder<T>

java.lang.Object
com.google.inject.internal.AbstractBindingBuilder<T>
Direct Known Subclasses:
BindingBuilder, ConstantBindingBuilderImpl

public abstract class AbstractBindingBuilder<T> extends Object
Base class used to create a new binding with the Guice EDSL described in Binder. Constructing an AbstractBindingBuilder will create a new binding and add it into the Binder.
Author:
jessewilson@google.com (Jesse Wilson)
  • Field Details

    • IMPLEMENTATION_ALREADY_SET

      public static final String IMPLEMENTATION_ALREADY_SET
      See Also:
    • SINGLE_INSTANCE_AND_SCOPE

      public static final String SINGLE_INSTANCE_AND_SCOPE
      See Also:
    • SCOPE_ALREADY_SET

      public static final String SCOPE_ALREADY_SET
      See Also:
    • BINDING_TO_NULL

      public static final String BINDING_TO_NULL
      See Also:
    • CONSTANT_VALUE_ALREADY_SET

      public static final String CONSTANT_VALUE_ALREADY_SET
      See Also:
    • ANNOTATION_ALREADY_SPECIFIED

      public static final String ANNOTATION_ALREADY_SPECIFIED
      See Also:
    • NULL_KEY

      protected static final Key<?> NULL_KEY
    • binder

      protected final Binder binder
      The binder that the new binding will be added to.
    • elements

      protected List<Element> elements
      The list of elements stored inside the binder. The new binding is added to this list.
    • position

      protected int position
      The index of the new binding in elements. This is used by subclasses of AbstractBindingBuilder to repeatedly replace the binding object in elements as more Guice EDSL methods are called to update the binding.
  • Constructor Details

  • Method Details

    • getBinding

      protected BindingImpl<T> getBinding()
    • setBinding

      protected BindingImpl<T> setBinding(BindingImpl<T> binding)
    • annotatedWithInternal

      protected BindingImpl<T> annotatedWithInternal(Class<? extends Annotation> annotationType)
      Sets the binding to a copy with the specified annotation on the bound key
    • annotatedWithInternal

      protected BindingImpl<T> annotatedWithInternal(Annotation annotation)
      Sets the binding to a copy with the specified annotation on the bound key
    • in

      public void in(Class<? extends Annotation> scopeAnnotation)
    • in

      public void in(Scope scope)
    • asEagerSingleton

      public void asEagerSingleton()
    • keyTypeIsSet

      protected boolean keyTypeIsSet()
    • checkNotTargetted

      protected void checkNotTargetted()
    • checkNotAnnotated

      protected void checkNotAnnotated()
    • checkNotScoped

      protected void checkNotScoped()