|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagecom.google.inject
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.
Binds method interceptor[s] to methods matched by class and method matchers. A method is eligible for interception if:Class Binder, void requireExplicitBindings()@param classMatcher matches classes the interceptor should apply to. For example: {@code only(Runnable.class)}. @param methodMatcher matches methods the interceptor should apply to. For example: {@code annotatedWith(Transactional.class)}. @param interceptors to bind. The interceptors are called in the order they are given.
- Guice created the instance the method is on
- Neither the enclosing type nor the method is final
- And the method is package-private, protected, or public
Instructs the Injector that bindings must be listed in a Module in order to be injected. Classes that are not explicitly bound in a module cannot be injected. Bindings created through a linkedbindingbinding (bind(Foo.class).to(FooImpl.class)
) are allowed, but the implicit binding (FooImpl
) cannot be directly injected unless it is also explicitly bound (bind(FooImpl.class)
).Tools can still retrieve bindings for implicit bindings (bindings created through a linked binding) if explicit bindings are required, however Binding.getProvider will fail.
By default, explicit bindings are not required.
If a parent injector requires explicit bindings, then all child injectors (and private modules within that injector) also require explicit bindings. If a parent does not require explicit bindings, a child injector or private module may optionally declare itself as requiring explicit bindings. If it does, the behavior is limited only to that child or any grandchildren. No siblings of the child will require explicit bindings.
IfIn theparent didabsencenot requireof an explicitbindingsbindingbutfor thechild doestarget,it is possible that alinked bindings in child injectorslinkedcreate a binding for the target in thechildparent.may add a JIT bindingSince this behavior can betosurprising,theitparent.causesThe child will not be allowed toan error instead if explicit bindings arereferencerequired.the target binding directlyTo avoid this error,butaddthe parent and other childrenan explicit binding for theoftarget,the parent may be ableeither in the child ortothe parent. @since 3.0
Creates an injector for the given set of modules. This is equivalent to calling .createInjector(Stage, Iterable) with Stage.DEVELOPMENT. @throws CreationException if one or more errors occur during injector creationClass Guice, Injector createInjector(Module[])
Creates an injector for the given set of modules. This is equivalent to calling .createInjector(Stage, Module...) with Stage.DEVELOPMENT. @throws CreationException if one or more errors occur during injector construction
Annotates members of your implementation class (constructors, methods and fields) into which the Injector should inject values. The Injector fulfills injection requests for:In all cases, a member can be injected regardless of its Java access specifier (private, default, protected, public). @author crazybob@google.com (Bob Lee)
- Every instance it constructs. The class being constructed must have exactly one of its constructors marked with {@code @Inject} or must have a constructor taking no parameters. The Injector then proceeds to perform
methodfield andfieldmethod injections.- Pre-constructed instances passed to Injector.injectMembers, com.google.inject.binder.LinkedBindingBuilder.toInstance(Object) and com.google.inject.binder.LinkedBindingBuilder.toProvider(javax.inject.Provider). In this case all constructors are, of course, ignored.
- Static fields and methods of classes which any Module has specifically requested static injection for, using Binder.requestStaticInjection.
Binding key consisting of an injection type and an optional annotation. Matches the type and annotation at a point of injection.Class Key, boolean hasAttributes()For example, {@code Key.get(Service.class, Transactional.class)} will match:
{@literal @}Inject public void setService({@literal @}Transactional Service service) { ... }{@code Key} supports generic types via subclassing just like TypeLiteral.
Keys do not differentiate between primitive types (int, char, etc.) and their
correpsondingcorresponding wrapper types (Integer, Character, etc.). Primitive types will be replaced with their wrapper types when keys are created. @author crazybob@google.com (Bob Lee)
Returns true if this key has annotation attributes.Class Key, Key<T> ofType(Class<T>)@since 3.0
Returns a new key of the specified type with the same annotation as this key.Class Key, Key<?> ofType(Type)@since 3.0
Returns a new key of the specified type with the same annotation as this key.Class Key, Key<T> ofType(TypeLiteral<T>)@since 3.0
Returns a new key of the specified type with the same annotation as this key.Class Key, Key<T> withoutAttributes()@since 3.0
Returns this key without annotation attributes, i.e. with only the annotation type.@since 3.0
Annotates methods of a Module to create a provider method binding. The method's return type is bound toit'sits returned value. Guice will pass dependencies to the method as parameters. @author crazybob@google.com (Bob Lee) @since 2.0