Top Description Fields Constructors Methods
com.google.inject.internal

public abstract Class AbstractBindingBuilder<T>

extends Object
Class Inheritance
Known Direct Subclasses
com.google.inject.internal.BindingBuilder, com.google.inject.internal.ConstantBindingBuilderImpl
Static Imports
com.google.common.base.Preconditions.checkNotNull

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
[email protected] (Jesse Wilson)

Field Summary

Modifier and TypeField and Description
public static final String
protected final Binder
binder

The binder that the new binding will be added to.

private BindingImpl<T>
binding

The new binding being added to the binder's elements list

public static final String
public static final String
protected List<Element>
elements

The list of elements stored inside the binder.

public static final String
protected static final Key<?>
protected int
position

The index of the new binding in elements.

public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public
AbstractBindingBuilder(Binder binder, List<Element> elements, Object source, Key<T> key)

Method Summary

Modifier and TypeMethod and Description
protected BindingImpl<T>
annotatedWithInternal(Class<? extends Annotation> annotationType)

Sets the binding to a copy with the specified annotation on the bound key

protected BindingImpl<T>
annotatedWithInternal(Annotation annotation)

Sets the binding to a copy with the specified annotation on the bound key

public void
protected void
protected void
protected void
protected BindingImpl<T>
public void
in(final Class<? extends Annotation> scopeAnnotation)

public void
in(final Scope scope)

protected boolean
protected BindingImpl<T>
setBinding(BindingImpl<T> binding)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANNOTATION_ALREADY_SPECIFIEDback to summary
public static final String ANNOTATION_ALREADY_SPECIFIED
binderback to summary
protected final Binder binder

The binder that the new binding will be added to.

bindingback to summary
private BindingImpl<T> binding

The new binding being added to the binder's elements list

BINDING_TO_NULLback to summary
public static final String BINDING_TO_NULL
CONSTANT_VALUE_ALREADY_SETback to summary
public static final String CONSTANT_VALUE_ALREADY_SET
elementsback to summary
protected List<Element> elements

The list of elements stored inside the binder. The new binding is added to this list.

IMPLEMENTATION_ALREADY_SETback to summary
public static final String IMPLEMENTATION_ALREADY_SET
NULL_KEYback to summary
protected static final Key<?> NULL_KEY
positionback to summary
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.

SCOPE_ALREADY_SETback to summary
public static final String SCOPE_ALREADY_SET
SINGLE_INSTANCE_AND_SCOPEback to summary
public static final String SINGLE_INSTANCE_AND_SCOPE

Constructor Detail

AbstractBindingBuilderback to summary
public AbstractBindingBuilder(Binder binder, List<Element> elements, Object source, Key<T> key)

Method Detail

annotatedWithInternalback to summary
protected BindingImpl<T> annotatedWithInternal(Class<? extends Annotation> annotationType)

Sets the binding to a copy with the specified annotation on the bound key

annotatedWithInternalback to summary
protected BindingImpl<T> annotatedWithInternal(Annotation annotation)

Sets the binding to a copy with the specified annotation on the bound key

asEagerSingletonback to summary
public void asEagerSingleton()
checkNotAnnotatedback to summary
protected void checkNotAnnotated()
checkNotScopedback to summary
protected void checkNotScoped()
checkNotTargettedback to summary
protected void checkNotTargetted()
getBindingback to summary
protected BindingImpl<T> getBinding()
inback to summary
public void in(final Class<? extends Annotation> scopeAnnotation)
inback to summary
public void in(final Scope scope)
keyTypeIsSetback to summary
protected boolean keyTypeIsSet()
setBindingback to summary
protected BindingImpl<T> setBinding(BindingImpl<T> binding)