|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagecom.google.inject.testing.fieldbinder
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Annotation used by BoundFieldModule to indicate that a field should be bound toits valueits value using Guice.Binding to {@code null} is only allowed for fields that are annotated {@code @Nullable}. See https://github.com/google/guice/wiki/UseNullable @see BoundFieldModule @author eatnumber1@google.com (Russ Harmon)
Automatically creates Guice bindings for fields in an object annotated with Bind.This module is intended for use in tests to reduce the code needed to bind local fields (usually mocks) for injection.
The following rules are followed in determining how fields are bound using this module:
- For each Bind annotated field of an object and its superclasses, this module
willwillbindbind that field's type to that field's value at injector creation time. This includesbothbothinstanceinstance and static fields.- If Bind.to is specified, the field's value will be bound to the class specified by Bind.to instead of the field's actual type.
- If Bind.lazy is true, this module will delay reading the value from the field until injection time, allowing the field's value to be reassigned during the course of a test's execution. If a BindingAnnotation or javax.inject.Qualifier is present on the field, that field will be bound using that annotation via AnnotatedBindingBuilder.annotatedWith.
For example, {@codecode bind(Foo.class).annotatedWith(BarAnnotation.class).toInstance(theValue)}.It is an errortoto supply more than one BindingAnnotationoror javax.inject.Qualifier.- If the field is of type Provider, the field's value will be bound as a Provider
using LinkedBindingBuilder.toProvider to the provider'sparameterizedparameterized type. For example,{@code Provider} binds to Integer. Attempting to bind aa non-parameterizedparameterized Provider without a Bind.to clause is an error.Example use:
@see Bind @author eatnumber1@google.com (Russ Harmon)public class TestFoo { // bind(new TypeLiteral{@code
>}() {}).toInstance(listOfObjects); {@literal @}Bind private List{@code