aboutsummaryrefslogtreecommitdiff
path: root/latest-api-diffs/4.0.xml
diff options
context:
space:
mode:
Diffstat (limited to 'latest-api-diffs/4.0.xml')
-rw-r--r--latest-api-diffs/4.0.xml1205
1 files changed, 1052 insertions, 153 deletions
diff --git a/latest-api-diffs/4.0.xml b/latest-api-diffs/4.0.xml
index 1b1e7d28..9ff6a102 100644
--- a/latest-api-diffs/4.0.xml
+++ b/latest-api-diffs/4.0.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
-<!-- on Thu Mar 20 20:36:47 PDT 2014 -->
+<!-- on Tue Apr 28 17:33:25 EDT 2015 -->
<api
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
@@ -9,7 +9,7 @@
name="4.0"
jdversion="1.1.1">
-<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /Users/cgruber/OpenSource/guice/googlecode-master/lib/build/jdiff/jdiff.jar:/Users/cgruber/OpenSource/guice/googlecode-master/lib/build/jdiff/xerces.jar -classpath /Users/cgruber/OpenSource/guice/googlecode-master/lib/javax.inject.jar:/Users/cgruber/OpenSource/guice/googlecode-master/lib/aopalliance.jar:/Users/cgruber/OpenSource/guice/googlecode-master/lib/guava-16.0.1.jar -doclet jdiff.JDiff -docletpath /Users/cgruber/OpenSource/guice/googlecode-master/lib/build/jdiff/jdiff.jar:/Users/cgruber/OpenSource/guice/googlecode-master/lib/build/jdiff/xerces.jar -apidir build/docs/latest-api-diffs -apiname 4.0 -->
+<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/jdiff.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/xerces.jar -classpath /usr/local/google/home/cgdecker/Projects/guice/lib/aopalliance.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/guava-16.0.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/javax.inject.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/asm-5.0.3.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/bnd-0.0.384.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/cglib-3.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/commons-logging-1.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/easymock.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/felix-2.0.5.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/guava-testlib-16.0.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jarjar-1.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/javax.inject-tck.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jsr305.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/junit.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/munge.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/safesax.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/spring-beans.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/spring-core.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/dagger-adapter/lib/dagger-2.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/antlr-2.7.5h3.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/aopalliance.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/cglib-nodep-3.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/commons-collections.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/commons-io.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/commons-logging-1.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/db4o-6.4.14.8131-java5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/dom4j-1.6.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/easymock.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/ejb3-persistence.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate-annotations.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate-entitymanager.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate-search.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate3.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hsqldb.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/javassist.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/jaxen-1.1-beta-7.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/jboss-archive-browsing.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/jta.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/log4j-1.2.14.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/ognl-2.6.7.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/oro-2.0.8.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/servlet-api-2.5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/xwork-2.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/ant-1.6.5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/commons-fileupload-1.2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/commons-io-1.3.2.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/commons-logging-1.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/core-3.1.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/freemarker-2.3.16.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/javassist.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jetty-6.1.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jetty-util-6.1.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jsp-2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jsp-api-2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/ognl-3.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/servlet-api-2.5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/struts2-core-2.2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/xwork-core-2.2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/build/classes -doclet jdiff.JDiff -docletpath /usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/jdiff.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/xerces.jar -apidir build/docs/latest-api-diffs -apiname 4.0 -->
<package name="com.google.inject">
<!-- start class com.google.inject.AbstractModule -->
<class name="AbstractModule" extends="java.lang.Object"
@@ -476,6 +476,22 @@
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <param name="dependency" type="com.google.inject.spi.Dependency&lt;T&gt;"/>
+ <doc>
+ <![CDATA[Returns the provider used to obtain instances for the given injection key.
+ The returned provider will be attached to the injection point and will
+ follow the nullability specified in the dependency.
+ Additionally, the returned provider will not be valid until the {@link Injector}
+ has been created. The provider will throw an {@code IllegalStateException} if you
+ try to use it beforehand.
+
+ @since 4.0]]>
+ </doc>
+ </method>
+ <method name="getProvider" return="com.google.inject.Provider&lt;T&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
<param name="type" type="java.lang.Class&lt;T&gt;"/>
<doc>
<![CDATA[Returns the provider used to obtain instances for the given injection type.
@@ -619,8 +635,8 @@
<doc>
<![CDATA[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 linked binding (
- <code>bind(Foo.class).to(FooImpl.class)</code>) are allowed, but the
+ injected. Bindings created through a linked binding
+ (<code>bind(Foo.class).to(FooImpl.class)</code>) are allowed, but the
implicit binding (<code>FooImpl</code>) cannot be directly injected unless
it is also explicitly bound (<code>bind(FooImpl.class)</code>).
<p>
@@ -637,10 +653,11 @@
does, the behavior is limited only to that child or any grandchildren. No
siblings of the child will require explicit bindings.
<p>
- If the parent did not require explicit bindings but the child does, it is
- possible that a linked binding in the child may add a JIT binding to the
- parent. The child will not be allowed to reference the target binding
- directly, but the parent and other children of the parent may be able to.
+ In the absence of an explicit binding for the target, linked bindings in
+ child injectors create a binding for the target in the parent. Since this
+ behavior can be surprising, it causes an error instead if explicit bindings
+ are required. To avoid this error, add an explicit binding for the target,
+ either in the child or the parent.
@since 3.0]]>
</doc>
@@ -692,6 +709,21 @@
@since 4.0]]>
</doc>
</method>
+ <method name="scanModulesForAnnotatedMethods"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="scanner" type="com.google.inject.spi.ModuleAnnotatedMethodScanner"/>
+ <doc>
+ <![CDATA[Adds a scanner that will look in all installed modules for annotations the scanner can parse,
+ and binds them like {@literal @}Provides methods. Scanners apply to all modules installed in
+ the injector. Scanners installed in child injectors or private modules do not impact modules in
+ siblings or parents, however scanners installed in parents do apply to all child injectors and
+ private modules.
+
+ @since 4.0]]>
+ </doc>
+ </method>
<doc>
<![CDATA[Collects configuration information (primarily <i>bindings</i>) which will be
used to create an {@link Injector}. Guice provides this object to your
@@ -1776,7 +1808,7 @@
TypeLiteral}.
<p>Keys do not differentiate between primitive types (int, char, etc.) and
- their correpsonding wrapper types (Integer, Character, etc.). Primitive
+ their corresponding wrapper types (Integer, Character, etc.). Primitive
types will be replaced with their wrapper types when keys are created.
@author crazybob@google.com (Bob Lee)]]>
@@ -2195,7 +2227,8 @@
<param name="bindingMatcher" type="com.google.inject.matcher.Matcher&lt;? super com.google.inject.Binding&lt;?&gt;&gt;"/>
<param name="listeners" type="com.google.inject.spi.ProvisionListener[]"/>
<doc>
- <![CDATA[@see Binder#bindListener(Matcher, ProvisionListener...)]]>
+ <![CDATA[@see Binder#bindListener(Matcher, ProvisionListener...)
+ @since 4.0]]>
</doc>
</method>
<doc>
@@ -2477,7 +2510,8 @@
@param binding binding to check
@param scope scope implementation instance
- @param scopeAnnotation scope annotation class]]>
+ @param scopeAnnotation scope annotation class
+ @since 4.0]]>
</doc>
</method>
<method name="isCircularProxy" return="boolean"
@@ -2491,7 +2525,9 @@
implementations should be careful to <b>not cache circular proxies</b>,
because the proxies are not intended for general purpose use. (They are
designed just to fulfill the immediate injection, not all injections.
- Caching them can lead to IllegalArgumentExceptions or ClassCastExceptions.)]]>
+ Caching them can lead to IllegalArgumentExceptions or ClassCastExceptions.)
+
+ @since 4.0]]>
</doc>
</method>
<field name="SINGLETON" type="com.google.inject.Scope"
@@ -3119,7 +3155,7 @@
<pre>install(new FactoryModuleBuilder()
.implement(Payment.class, RealPayment.class)
- .build(PaymentFactory.class);</pre>
+ .build(PaymentFactory.class));</pre>
As a side-effect of this binding, Guice will inject the factory to initialize it for use. The
factory cannot be used until the injector has been initialized.
@@ -3141,7 +3177,7 @@
// excluding .implement for Shipment means the implementation class
// will be 'Shipment' itself, which is legal if it's not an interface.
.implement(Receipt.class, RealReceipt.class)
- .build(OrderFactory.class);</pre>
+ .build(OrderFactory.class));</pre>
</pre>
<h3>Using the factory</h3>
@@ -3260,6 +3296,17 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
</method>
+ <method name="hashCode" return="int"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ </method>
+ <method name="equals" return="boolean"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="obj" type="java.lang.Object"/>
+ </method>
<doc>
<![CDATA[<strong>Obsolete.</strong> Prefer {@link FactoryModuleBuilder} for its more concise API and
additional capability.
@@ -3628,7 +3675,8 @@
<doc>
<![CDATA[See the EDSL examples at {@link com.google.inject.Binder}.
- @see com.google.inject.Injector#injectMembers]]>
+ @see com.google.inject.Injector#injectMembers
+ @since 4.0]]>
</doc>
</method>
<method name="toProvider" return="com.google.inject.binder.ScopedBindingBuilder"
@@ -3729,6 +3777,53 @@
</interface>
<!-- end interface com.google.inject.binder.ScopedBindingBuilder -->
</package>
+<package name="com.google.inject.daggeradapter">
+ <!-- start class com.google.inject.daggeradapter.DaggerAdapter -->
+ <class name="DaggerAdapter" extends="java.lang.Object"
+ abstract="false"
+ static="false" final="true" visibility="public"
+ deprecated="not deprecated">
+ <method name="from" return="com.google.inject.Module"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="daggerModuleObjects" type="java.lang.Object[]"/>
+ <doc>
+ <![CDATA[Returns a guice module from a dagger module.
+
+ <p>Note: At present, it does not honor {@code @Module(includes=...)} directives.]]>
+ </doc>
+ </method>
+ <doc>
+ <![CDATA[A utility to adapt classes annotated with {@link @dagger.Module} such that their
+ {@link @dagger.Provides} methods can be properly invoked by Guice to perform their
+ provision operations.
+
+ <p>Simple example: <pre>{@code
+ Guice.createInjector(...other modules..., DaggerAdapter.from(new SomeDaggerAdapter()));
+ }</pre>
+
+ <p>Some notes on usage and compatibility.
+ <ul>
+ <li>Dagger provider methods have a "SET_VALUES" provision mode not supported by Guice.
+ <li>MapBindings are not yet implemented (pending).
+ <li>Be careful about stateful modules. In contrast to Dagger (where components are
+ expected to be recreated on-demand with new Module instances), Guice typically
+ has a single injector with a long lifetime, so your module instance will be used
+ throughout the lifetime of the entire app.
+ <li>Dagger 1.x uses {@link @Singleton} for all scopes, including shorter-lived scopes
+ like per-request or per-activity. Using modules written with Dagger 1.x usage
+ in mind may result in mis-scoped objects.
+ <li>Dagger 2.x supports custom scope annotations, but for use in Guice, a custom scope
+ implementation must be registered in order to support the custom lifetime of that
+ annotation.
+ </ul>
+
+ @author cgruber@google.com (Christian Gruber)]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.daggeradapter.DaggerAdapter -->
+</package>
<package name="com.google.inject.grapher">
<!-- start class com.google.inject.grapher.AbstractInjectorGrapher -->
<class name="AbstractInjectorGrapher" extends="java.lang.Object"
@@ -3830,7 +3925,8 @@
<doc>
<![CDATA[Abstract injector grapher that builds the dependency graph but doesn't render it.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.AbstractInjectorGrapher -->
@@ -3888,7 +3984,8 @@
<param name="edgeCreator" type="com.google.inject.grapher.EdgeCreator"/>
</method>
<doc>
- <![CDATA[Parameters used to override default settings of the grapher.]]>
+ <![CDATA[Parameters used to override default settings of the grapher.
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.AbstractInjectorGrapher.GrapherParameters -->
@@ -3915,7 +4012,8 @@
<![CDATA[Alias between two nodes. Causes the 'from' node to be aliased with the 'to' node, which means
that the 'from' node is not rendered and all edges going to it instead go to the 'to' node.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.Alias -->
@@ -3941,7 +4039,8 @@
<![CDATA[Creator of node aliases. Used by dependency graphers to merge nodes in the internal Guice graph
into a single node on the rendered graph.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</interface>
<!-- end interface com.google.inject.grapher.AliasCreator -->
@@ -3985,7 +4084,8 @@
<doc>
<![CDATA[Edge that connects an interface to the type or instance that is bound to implement it.
- @author phopkins@gmail.com (Pete Hopkins)]]>
+ @author phopkins@gmail.com (Pete Hopkins)
+ @since 4.0 (since 2.0 as an interface)]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.BindingEdge -->
@@ -4030,7 +4130,8 @@
<![CDATA[Root key set creator that starts with all types that are not Guice internal types or the
{@link Logger} type.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.DefaultRootKeySetCreator -->
@@ -4075,7 +4176,8 @@
<![CDATA[Edge from a class or {@link InjectionPoint} to the interface node that will satisfy the
dependency.
- @author phopkins@gmail.com (Pete Hopkins)]]>
+ @author phopkins@gmail.com (Pete Hopkins)
+ @since 4.0 (since 2.0 as an interface)]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.DependencyEdge -->
@@ -4126,7 +4228,8 @@
<doc>
<![CDATA[Edge in a guice dependency graph.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.Edge -->
@@ -4147,7 +4250,8 @@
<![CDATA[Creator of graph edges to render. All edges will be rendered on the graph after node aliasing is
performed.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</interface>
<!-- end interface com.google.inject.grapher.EdgeCreator -->
@@ -4188,12 +4292,13 @@
<param name="id" type="com.google.inject.grapher.NodeId"/>
</method>
<doc>
- <![CDATA[Node for types that have {@link Dependency}s and are bound to {@link InterfaceNode}s. These
- nodes will often have fields for {@link Member}s that are {@link InjectionPoint}s.
+ <![CDATA[Node for types that have {@link com.google.inject.spi.Dependency}s and are
+ bound to {@link InterfaceNode}s. These nodes will often have fields for
+ {@link Member}s that are {@link com.google.inject.spi.InjectionPoint}s.
@see DependencyEdge
-
- @author phopkins@gmail.com (Pete Hopkins)]]>
+ @author phopkins@gmail.com (Pete Hopkins)
+ @since 4.0 (since 2.0 as an interface)]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.ImplementationNode -->
@@ -4227,7 +4332,8 @@
<![CDATA[Guice injector grapher. Renders the guice dependency graph for an injector. It can render the
whole dependency graph or just transitive dependencies of a given set of nodes.
- @author phopkins@gmail.com (Pete Hopkins)]]>
+ @author phopkins@gmail.com (Pete Hopkins)
+ @since 4.0 (since 2.0 as a concrete class with a different API)]]>
</doc>
</interface>
<!-- end interface com.google.inject.grapher.InjectorGrapher -->
@@ -4275,7 +4381,8 @@
<doc>
<![CDATA[Node for instances. Used when a type is bound to an instance.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.InstanceNode -->
@@ -4309,8 +4416,8 @@
<![CDATA[Node for an interface type that has been bound to an implementation class or instance.
@see BindingEdge
-
- @author phopkins@gmail.com (Pete Hopkins)]]>
+ @author phopkins@gmail.com (Pete Hopkins)
+ @since 4.0 (since 2.0 as an interface)]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.InterfaceNode -->
@@ -4350,7 +4457,8 @@
</method>
<doc>
<![CDATA[Interface for a service that provides nice {@link String}s that we can
- display in the graph for the types that come up in {@link Binding}s.
+ display in the graph for the types that come up in
+ {@link com.google.inject.Binding}s.
@author phopkins@gmail.com (Pete Hopkins)]]>
</doc>
@@ -4401,7 +4509,8 @@
<doc>
<![CDATA[Node in a guice dependency graph.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.Node -->
@@ -4421,7 +4530,8 @@
<doc>
<![CDATA[Creator of graph nodes.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</interface>
<!-- end interface com.google.inject.grapher.NodeCreator -->
@@ -4470,7 +4580,8 @@
interface node with the key of {@code Key<Integer>} and an instance node with the same
{@link Key} and value of 42.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.NodeId -->
@@ -4491,7 +4602,9 @@
<param name="name" type="java.lang.String"/>
</method>
<doc>
- <![CDATA[Type of node.]]>
+ <![CDATA[Type of node.
+
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.NodeId.NodeType -->
@@ -4512,7 +4625,8 @@
<![CDATA[Creator of the default starting set of keys to graph. These keys and their transitive
dependencies will be graphed.
- @author bojand@google.com (Bojan Djordjevic)]]>
+ @author bojand@google.com (Bojan Djordjevic)
+ @since 4.0]]>
</doc>
</interface>
<!-- end interface com.google.inject.grapher.RootKeySetCreator -->
@@ -4638,12 +4752,15 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="binding" type="com.google.inject.Binding&lt;?&gt;"/>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<doc>
- <![CDATA[{@link BindingTargetVisitor} that returns a {@link Collection} of the
- {@link Key}s of each {@link Binding}'s dependencies. Used by
- {@link InjectorGrapher} to walk the dependency graph from a starting set of
- {@link Binding}s.
+ <![CDATA[{@link com.google.inject.spi.BindingTargetVisitor} that returns a
+ {@link Collection} of the {@link Key}s of each {@link Binding}'s
+ dependencies. Used by {@link InjectorGrapher} to walk the dependency graph
+ from a starting set of {@link Binding}s.
@author phopkins@gmail.com (Pete Hopkins)]]>
</doc>
@@ -4756,6 +4873,9 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="getHeadPortId" return="java.lang.String"
abstract="false" native="false" synchronized="false"
@@ -4794,6 +4914,9 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="getTailPortId" return="java.lang.String"
abstract="false" native="false" synchronized="false"
@@ -4986,12 +5109,13 @@
<param name="edge" type="com.google.inject.grapher.BindingEdge"/>
</method>
<doc>
- <![CDATA[{@link InjectorGrapher} implementation that writes out a Graphviz DOT file of the graph.
- Dependencies are bound in {@link GraphvizModule}.
+ <![CDATA[{@link com.google.inject.grapher.InjectorGrapher} implementation that writes out a Graphviz DOT
+ file of the graph. Dependencies are bound in {@link GraphvizModule}.
<p>
Specify the {@link PrintWriter} to output to with {@link #setOut(PrintWriter)}.
- @author phopkins@gmail.com (Pete Hopkins)]]>
+ @author phopkins@gmail.com (Pete Hopkins)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.grapher.graphviz.GraphvizGrapher -->
@@ -5024,11 +5148,17 @@
<constructor name="GraphvizNode" type="com.google.inject.grapher.NodeId"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</constructor>
<method name="getNodeId" return="com.google.inject.grapher.NodeId"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="getShape" return="com.google.inject.grapher.graphviz.NodeShape"
abstract="false" native="false" synchronized="false"
@@ -5113,12 +5243,18 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="setIdentifier"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="identifier" type="java.lang.String"/>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<doc>
<![CDATA[Data object to encapsulate the attributes of Graphviz nodes that we're
@@ -5200,7 +5336,7 @@
</method>
<doc>
<![CDATA[Interface for a service that returns Graphviz port IDs, used for naming the
- rows in {@link ImplementationNode}-displaying {@link GraphvizNode}s.
+ rows in {@link com.google.inject.grapher.ImplementationNode}-displaying {@link GraphvizNode}s.
@author phopkins@gmail.com (Pete Hopkins)]]>
</doc>
@@ -5440,6 +5576,18 @@
<!-- end class com.google.inject.matcher.Matchers -->
</package>
<package name="com.google.inject.multibindings">
+ <!-- start class com.google.inject.multibindings.ClassMapKey -->
+ <class name="ClassMapKey" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Allows {@literal @}{@link ProvidesIntoMap} to specify a class map key.
+
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.ClassMapKey -->
<!-- start class com.google.inject.multibindings.MapBinder -->
<class name="MapBinder" extends="java.lang.Object"
abstract="true"
@@ -5723,6 +5871,37 @@
</doc>
</interface>
<!-- end interface com.google.inject.multibindings.MapBinderBinding -->
+ <!-- start class com.google.inject.multibindings.MapKey -->
+ <class name="MapKey" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Allows users define customized key type annotations for map bindings by annotating an annotation
+ of a {@code Map}'s key type. The custom key annotation can be applied to methods also annotated
+ with {@literal @}{@link ProvidesIntoMap}.
+
+ <p>A {@link StringMapKey} and {@link ClassMapKey} are provided for convenience with maps whose
+ keys are strings or classes. For maps with enums or primitive types as keys, you must provide
+ your own MapKey annotation, such as this one for an enum:
+
+ <pre>
+ {@literal @}MapKey(unwrapValue = true)
+ {@literal @}Retention(RUNTIME)
+ public {@literal @}interface MyCustomEnumKey {
+ MyCustomEnum value();
+ }
+ </pre>
+
+ You can also use the whole annotation as the key, if {@code unwrapValue=false}.
+ When unwrapValue is false, the annotation type will be the key type for the injected map and
+ the annotation instances will be the key values. If {@code unwrapValue=true}, the value() type
+ will be the key type for injected map and the value() instances will be the keys values.
+
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.MapKey -->
<!-- start class com.google.inject.multibindings.Multibinder -->
<class name="Multibinder" extends="java.lang.Object"
abstract="true"
@@ -5791,6 +5970,19 @@
static="true" final="false" visibility="public"
deprecated="not deprecated">
<param name="binder" type="com.google.inject.Binder"/>
+ <param name="key" type="com.google.inject.Key&lt;T&gt;"/>
+ <doc>
+ <![CDATA[Returns a new multibinder that collects instances of the key's type in a {@link Set} that is
+ itself bound with the annotation (if any) of the key.
+
+ @since 4.0]]>
+ </doc>
+ </method>
+ <method name="newSetBinder" return="com.google.inject.multibindings.Multibinder&lt;T&gt;"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
<param name="type" type="java.lang.Class&lt;T&gt;"/>
<param name="annotationType" type="java.lang.Class&lt;? extends java.lang.annotation.Annotation&gt;"/>
<doc>
@@ -5849,6 +6041,8 @@
public SnackMachine(Set&lt;Snack&gt; snacks) { ... }
}</code></pre>
+ If desired, {@link Collection}{@code <Provider<Snack>>} can also be injected.
+
<p>Contributing multibindings from different modules is supported. For
example, it is okay for both {@code CandyModule} and {@code ChipsModule}
to create their own {@code Multibinder<Snack>}, and to each contribute
@@ -5958,6 +6152,41 @@
</doc>
</interface>
<!-- end interface com.google.inject.multibindings.MultibinderBinding -->
+ <!-- start class com.google.inject.multibindings.MultibindingsScanner -->
+ <class name="MultibindingsScanner" extends="java.lang.Object"
+ abstract="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <method name="asModule" return="com.google.inject.Module"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns a module that, when installed, will scan all modules for methods with the annotations
+ {@literal @}{@link ProvidesIntoMap}, {@literal @}{@link ProvidesIntoSet}, and
+ {@literal @}{@link ProvidesIntoOptional}.
+
+ <p>This is a convenience method, equivalent to doing
+ {@code binder().scanModulesForAnnotatedMethods(MultibindingsScanner.scanner())}.]]>
+ </doc>
+ </method>
+ <method name="scanner" return="com.google.inject.spi.ModuleAnnotatedMethodScanner"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns a {@link ModuleAnnotatedMethodScanner} that, when bound, will scan all modules for
+ methods with the annotations {@literal @}{@link ProvidesIntoMap},
+ {@literal @}{@link ProvidesIntoSet}, and {@literal @}{@link ProvidesIntoOptional}.]]>
+ </doc>
+ </method>
+ <doc>
+ <![CDATA[Scans a module for annotations that signal multibindings, mapbindings, and optional bindings.
+
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.MultibindingsScanner -->
<!-- start interface com.google.inject.multibindings.MultibindingsTargetVisitor -->
<interface name="MultibindingsTargetVisitor" abstract="true"
static="false" final="false" visibility="public"
@@ -5981,17 +6210,384 @@
<![CDATA[Visits a binding created through {@link MapBinder}.]]>
</doc>
</method>
+ <method name="visit" return="V"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="optionalbinding" type="com.google.inject.multibindings.OptionalBinderBinding&lt;? extends T&gt;"/>
+ <doc>
+ <![CDATA[Visits a binding created through {@link OptionalBinder}.
+
+ @since 4.0]]>
+ </doc>
+ </method>
<doc>
<![CDATA[A visitor for the multibinder extension.
<p>
If your {@link BindingTargetVisitor} implements this interface, bindings created by using
- {@link Multibinder} or {@link MapBinder} will be visited through this interface.
-
+ {@link Multibinder}, {@link MapBinder} or {@link OptionalBinderBinding} will be visited through
+ this interface.
+
@since 3.0
@author sameb@google.com (Sam Berlin)]]>
</doc>
</interface>
<!-- end interface com.google.inject.multibindings.MultibindingsTargetVisitor -->
+ <!-- start class com.google.inject.multibindings.OptionalBinder -->
+ <class name="OptionalBinder" extends="java.lang.Object"
+ abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <method name="newOptionalBinder" return="com.google.inject.multibindings.OptionalBinder&lt;T&gt;"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
+ <param name="type" type="java.lang.Class&lt;T&gt;"/>
+ </method>
+ <method name="newOptionalBinder" return="com.google.inject.multibindings.OptionalBinder&lt;T&gt;"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
+ <param name="type" type="com.google.inject.TypeLiteral&lt;T&gt;"/>
+ </method>
+ <method name="newOptionalBinder" return="com.google.inject.multibindings.OptionalBinder&lt;T&gt;"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
+ <param name="type" type="com.google.inject.Key&lt;T&gt;"/>
+ </method>
+ <method name="setDefault" return="com.google.inject.binder.LinkedBindingBuilder&lt;T&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns a binding builder used to set the default value that will be injected.
+ The binding set by this method will be ignored if {@link #setBinding} is called.
+
+ <p>It is an error to call this method without also calling one of the {@code to}
+ methods on the returned binding builder.]]>
+ </doc>
+ </method>
+ <method name="setBinding" return="com.google.inject.binder.LinkedBindingBuilder&lt;T&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns a binding builder used to set the actual value that will be injected.
+ This overrides any binding set by {@link #setDefault}.
+
+ <p>It is an error to call this method without also calling one of the {@code to}
+ methods on the returned binding builder.]]>
+ </doc>
+ </method>
+ <doc>
+ <![CDATA[An API to bind optional values, optionally with a default value.
+ OptionalBinder fulfills two roles: <ol>
+ <li>It allows a framework to define an injection point that may or
+ may not be bound by users.
+ <li>It allows a framework to supply a default value that can be changed
+ by users.
+ </ol>
+
+ <p>When an OptionalBinder is added, it will always supply the bindings:
+ {@code Optional<T>} and {@code Optional<Provider<T>>}. If
+ {@link #setBinding} or {@link #setDefault} are called, it will also
+ bind {@code T}.
+
+ <p>{@code setDefault} is intended for use by frameworks that need a default
+ value. User code can call {@code setBinding} to override the default.
+ <b>Warning: Even if setBinding is called, the default binding
+ will still exist in the object graph. If it is a singleton, it will be
+ instantiated in {@code Stage.PRODUCTION}.</b>
+
+ <p>If setDefault or setBinding are linked to Providers, the Provider may return
+ {@code null}. If it does, the Optional bindings will be absent. Binding
+ setBinding to a Provider that returns null will not cause OptionalBinder
+ to fall back to the setDefault binding.
+
+ <p>If neither setDefault nor setBinding are called, it will try to link to a
+ user-supplied binding of the same type. If no binding exists, the optionals
+ will be absent. Otherwise, if a user-supplied binding of that type exists,
+ or if setBinding or setDefault are called, the optionals will return present
+ if they are bound to a non-null value.
+
+ <p>Values are resolved at injection time. If a value is bound to a
+ provider, that provider's get method will be called each time the optional
+ is injected (unless the binding is also scoped, or an optional of provider is
+ injected).
+
+ <p>Annotations are used to create different optionals of the same key/value
+ type. Each distinct annotation gets its own independent binding.
+
+ <pre><code>
+ public class FrameworkModule extends AbstractModule {
+ protected void configure() {
+ OptionalBinder.newOptionalBinder(binder(), Renamer.class);
+ }
+ }</code></pre>
+
+ <p>With this module, an {@link Optional}{@code <Renamer>} can now be
+ injected. With no other bindings, the optional will be absent.
+ Users can specify bindings in one of two ways:
+
+ <p>Option 1:
+ <pre><code>
+ public class UserRenamerModule extends AbstractModule {
+ protected void configure() {
+ bind(Renamer.class).to(ReplacingRenamer.class);
+ }
+ }</code></pre>
+
+ <p>or Option 2:
+ <pre><code>
+ public class UserRenamerModule extends AbstractModule {
+ protected void configure() {
+ OptionalBinder.newOptionalBinder(binder(), Renamer.class)
+ .setBinding().to(ReplacingRenamer.class);
+ }
+ }</code></pre>
+ With both options, the {@code Optional<Renamer>} will be present and supply the
+ ReplacingRenamer.
+
+ <p>Default values can be supplied using:
+ <pre><code>
+ public class FrameworkModule extends AbstractModule {
+ protected void configure() {
+ OptionalBinder.newOptionalBinder(binder(), Key.get(String.class, LookupUrl.class))
+ .setDefault().toInstance(DEFAULT_LOOKUP_URL);
+ }
+ }</code></pre>
+ With the above module, code can inject an {@code @LookupUrl String} and it
+ will supply the DEFAULT_LOOKUP_URL. A user can change this value by binding
+ <pre><code>
+ public class UserLookupModule extends AbstractModule {
+ protected void configure() {
+ OptionalBinder.newOptionalBinder(binder(), Key.get(String.class, LookupUrl.class))
+ .setBinding().toInstance(CUSTOM_LOOKUP_URL);
+ }
+ }</code></pre>
+ ... which will override the default value.
+
+ <p>If one module uses setDefault the only way to override the default is to use setBinding.
+ It is an error for a user to specify the binding without using OptionalBinder if
+ setDefault or setBinding are called. For example,
+ <pre><code>
+ public class FrameworkModule extends AbstractModule {
+ protected void configure() {
+ OptionalBinder.newOptionalBinder(binder(), Key.get(String.class, LookupUrl.class))
+ .setDefault().toInstance(DEFAULT_LOOKUP_URL);
+ }
+ }
+ public class UserLookupModule extends AbstractModule {
+ protected void configure() {
+ bind(Key.get(String.class, LookupUrl.class)).toInstance(CUSTOM_LOOKUP_URL);
+ }
+ }</code></pre>
+ ... would generate an error, because both the framework and the user are trying to bind
+ {@code @LookupUrl String}.
+
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.OptionalBinder -->
+ <!-- start interface com.google.inject.multibindings.OptionalBinderBinding -->
+ <interface name="OptionalBinderBinding" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <method name="getKey" return="com.google.inject.Key&lt;T&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns the {@link Key} for this binding.]]>
+ </doc>
+ </method>
+ <method name="getDefaultBinding" return="com.google.inject.Binding&lt;?&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns the default binding (set by {@link OptionalBinder#setDefault}) if one exists or null
+ if no default binding is set. This will throw {@link UnsupportedOperationException} if it is
+ called on an element retrieved from {@link Elements#getElements}.
+ <p>
+ The Binding's type will always match the type Optional's generic type. For example, if getKey
+ returns a key of <code>Optional&lt;String></code>, then this will always return a
+ <code>Binding&lt;String></code>.]]>
+ </doc>
+ </method>
+ <method name="getActualBinding" return="com.google.inject.Binding&lt;?&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns the actual binding (set by {@link OptionalBinder#setBinding}) or null if not set.
+ This will throw {@link UnsupportedOperationException} if it is called on an element retrieved
+ from {@link Elements#getElements}.
+ <p>
+ The Binding's type will always match the type Optional's generic type. For example, if getKey
+ returns a key of <code>Optional&lt;String></code>, then this will always return a
+ <code>Binding&lt;String></code>.]]>
+ </doc>
+ </method>
+ <method name="containsElement" return="boolean"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="element" type="com.google.inject.spi.Element"/>
+ <doc>
+ <![CDATA[Returns true if this OptionalBinder contains the given Element in order to build the optional
+ binding or uses the given Element in order to support building and injecting its data. This
+ will work for OptionalBinderBinding retrieved from an injector and
+ {@link Elements#getElements}. Usually this is only necessary if you are working with elements
+ retrieved from modules (without an Injector), otherwise {@link #getDefaultBinding} and
+ {@link #getActualBinding} are better options.]]>
+ </doc>
+ </method>
+ <doc>
+ <![CDATA[A binding for a OptionalBinder.
+
+ <p>Although OptionalBinders may be injected through a variety of types
+ {@code T}, {@code Optional<T>}, {@code Optional<Provider<T>>}, etc..), an
+ OptionalBinderBinding exists only on the Binding associated with the
+ {@code Optional<T>} key. Other bindings can be validated to be derived from this
+ OptionalBinderBinding using {@link #containsElement}.
+
+ @param <T> The fully qualified type of the optional binding, including Optional.
+ For example: {@code Optional<String>}.
+
+ @since 4.0
+ @author sameb@google.com (Sam Berlin)]]>
+ </doc>
+ </interface>
+ <!-- end interface com.google.inject.multibindings.OptionalBinderBinding -->
+ <!-- start class com.google.inject.multibindings.ProvidesIntoMap -->
+ <class name="ProvidesIntoMap" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Annotates methods of a {@link Module} to add items to a {@link MapBinder}.
+ The method's return type, binding annotation and additional key annotation determines
+ what Map this will contribute to. For example,
+
+ <pre>
+ {@literal @}ProvidesIntoMap
+ {@literal @}StringMapKey("Foo")
+ {@literal @}Named("plugins")
+ Plugin provideFooUrl(FooManager fm) { returm fm.getPlugin(); }
+
+ {@literal @}ProvidesIntoMap
+ {@literal @}StringMapKey("Bar")
+ {@literal @}Named("urls")
+ Plugin provideBarUrl(BarManager bm) { return bm.getPlugin(); }
+ </pre>
+
+ will add two items to the {@code @Named("urls") Map<String, Plugin>} map. The key 'Foo'
+ will map to the provideFooUrl method, and the key 'Bar' will map to the provideBarUrl method.
+ The values are bound as providers and will be evaluated at injection time.
+
+ <p>Because the key is specified as an annotation, only Strings, Classes, enums, primitive
+ types and annotation instances are supported as keys.
+
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.ProvidesIntoMap -->
+ <!-- start class com.google.inject.multibindings.ProvidesIntoOptional -->
+ <class name="ProvidesIntoOptional" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Annotates methods of a {@link Module} to add items to a {@link Multibinder}.
+ The method's return type and binding annotation determines what Optional this will
+ contribute to. For example,
+
+ <pre>
+ {@literal @}ProvidesIntoOptional(DEFAULT)
+ {@literal @}Named("url")
+ String provideFooUrl(FooManager fm) { returm fm.getUrl(); }
+
+ {@literal @}ProvidesIntoOptional(ACTUAL)
+ {@literal @}Named("url")
+ String provideBarUrl(BarManager bm) { return bm.getUrl(); }
+ </pre>
+
+ will set the default value of {@code @Named("url") Optional<String>} to foo's URL,
+ and then override it to bar's URL.
+
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.ProvidesIntoOptional -->
+ <!-- start class com.google.inject.multibindings.ProvidesIntoOptional.Type -->
+ <class name="ProvidesIntoOptional.Type" extends="java.lang.Enum&lt;com.google.inject.multibindings.ProvidesIntoOptional.Type&gt;"
+ abstract="false"
+ static="true" final="true" visibility="public"
+ deprecated="not deprecated">
+ <method name="values" return="com.google.inject.multibindings.ProvidesIntoOptional.Type[]"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ </method>
+ <method name="valueOf" return="com.google.inject.multibindings.ProvidesIntoOptional.Type"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="name" type="java.lang.String"/>
+ </method>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.ProvidesIntoOptional.Type -->
+ <!-- start class com.google.inject.multibindings.ProvidesIntoSet -->
+ <class name="ProvidesIntoSet" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Annotates methods of a {@link Module} to add items to a {@link Multibinder}.
+ The method's return type and binding annotation determines what Set this will
+ contribute to. For example,
+
+ <pre>
+ {@literal @}ProvidesIntoSet
+ {@literal @}Named("urls")
+ String provideFooUrl(FooManager fm) { returm fm.getUrl(); }
+
+ {@literal @}ProvidesIntoSet
+ {@literal @}Named("urls")
+ String provideBarUrl(BarManager bm) { return bm.getUrl(); }
+ </pre>
+
+ will add two items to the {@code @Named("urls") Set<String>} set. The items are bound as
+ providers and will be evaluated at injection time.
+
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.ProvidesIntoSet -->
+ <!-- start class com.google.inject.multibindings.StringMapKey -->
+ <class name="StringMapKey" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Allows {@literal @}{@link ProvidesIntoMap} to specify a string map key.
+
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.multibindings.StringMapKey -->
</package>
<package name="com.google.inject.name">
<!-- start class com.google.inject.name.Named -->
@@ -6057,6 +6653,7 @@
abstract="false"
static="false" final="true" visibility="public"
deprecated="not deprecated">
+ <implements name="javax.servlet.Filter"/>
<constructor name="PersistFilter" type="com.google.inject.persist.UnitOfWork, com.google.inject.persist.PersistService"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6065,8 +6662,8 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filterConfig" type="FilterConfig"/>
- <exception name="ServletException" type="ServletException"/>
+ <param name="filterConfig" type="javax.servlet.FilterConfig"/>
+ <exception name="ServletException" type="javax.servlet.ServletException"/>
</method>
<method name="destroy"
abstract="false" native="false" synchronized="false"
@@ -6077,11 +6674,11 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletRequest" type="ServletRequest"/>
- <param name="servletResponse" type="ServletResponse"/>
- <param name="filterChain" type="FilterChain"/>
+ <param name="servletRequest" type="javax.servlet.ServletRequest"/>
+ <param name="servletResponse" type="javax.servlet.ServletResponse"/>
+ <param name="filterChain" type="javax.servlet.FilterChain"/>
<exception name="IOException" type="java.io.IOException"/>
- <exception name="ServletException" type="ServletException"/>
+ <exception name="ServletException" type="javax.servlet.ServletException"/>
</method>
<doc>
<![CDATA[Apply this filter to enable the HTTP Request unit of work and to have
@@ -6197,7 +6794,8 @@
<implements name="java.lang.annotation.Annotation"/>
<doc>
<![CDATA[<p> Any method or class marked with this annotation will be considered for transactionality.
- Consult the documentation on http://code.google.com/p/google-guice for detailed semantics.
+ Consult the documentation on https://github.com/google/guice/wiki/GuicePersist for detailed
+ semantics.
Marking a method {@code @Transactional} will start a new transaction before the method
executes and commit it after the method returns.
<p>
@@ -6361,12 +6959,13 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="properties" type="java.util.Properties"/>
+ <param name="properties" type="java.util.Map&lt;?, ?&gt;"/>
<doc>
<![CDATA[Configures the JPA persistence provider with a set of properties.
@param properties A set of name value pairs that configure a JPA persistence
- provider as per the specification.]]>
+ provider as per the specification.
+ @since 4.0 (since 3.0 with a parameter type of {@code java.util.Properties})]]>
</doc>
</method>
<method name="addFinder" return="com.google.inject.persist.jpa.JpaPersistModule"
@@ -6394,6 +6993,7 @@
abstract="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <implements name="javax.servlet.Filter"/>
<constructor name="GuiceFilter"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6402,18 +7002,18 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletRequest" type="ServletRequest"/>
- <param name="servletResponse" type="ServletResponse"/>
- <param name="filterChain" type="FilterChain"/>
+ <param name="servletRequest" type="javax.servlet.ServletRequest"/>
+ <param name="servletResponse" type="javax.servlet.ServletResponse"/>
+ <param name="filterChain" type="javax.servlet.FilterChain"/>
<exception name="IOException" type="java.io.IOException"/>
- <exception name="ServletException" type="ServletException"/>
+ <exception name="ServletException" type="javax.servlet.ServletException"/>
</method>
<method name="init"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filterConfig" type="FilterConfig"/>
- <exception name="ServletException" type="ServletException"/>
+ <param name="filterConfig" type="javax.servlet.FilterConfig"/>
+ <exception name="ServletException" type="javax.servlet.ServletException"/>
</method>
<method name="destroy"
abstract="false" native="false" synchronized="false"
@@ -6451,6 +7051,7 @@
abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
+ <implements name="javax.servlet.ServletContextListener"/>
<constructor name="GuiceServletContextListener"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6459,13 +7060,13 @@
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletContextEvent" type="ServletContextEvent"/>
+ <param name="servletContextEvent" type="javax.servlet.ServletContextEvent"/>
</method>
<method name="contextDestroyed"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletContextEvent" type="ServletContextEvent"/>
+ <param name="servletContextEvent" type="javax.servlet.ServletContextEvent"/>
</method>
<method name="getInjector" return="com.google.inject.Injector"
abstract="true" native="false" synchronized="false"
@@ -6491,7 +7092,7 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="com.google.inject.servlet.ServletModuleBinding"/>
- <method name="getFilterInstance" return="Filter"
+ <method name="getFilterInstance" return="javax.servlet.Filter"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6512,7 +7113,7 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="com.google.inject.servlet.ServletModuleBinding"/>
- <method name="getServletInstance" return="HttpServlet"
+ <method name="getServletInstance" return="javax.servlet.http.HttpServlet"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6533,7 +7134,7 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="com.google.inject.servlet.ServletModuleBinding"/>
- <method name="getLinkedKey" return="com.google.inject.Key&lt;? extends Filter&gt;"
+ <method name="getLinkedKey" return="com.google.inject.Key&lt;? extends javax.servlet.Filter&gt;"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6554,7 +7155,7 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="com.google.inject.servlet.ServletModuleBinding"/>
- <method name="getLinkedKey" return="com.google.inject.Key&lt;? extends HttpServlet&gt;"
+ <method name="getLinkedKey" return="com.google.inject.Key&lt;? extends javax.servlet.http.HttpServlet&gt;"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -6607,7 +7208,8 @@
<doc>
<![CDATA[Exception thrown when there was a failure entering request scope.
- @author Chris Nokleberg]]>
+ @author Chris Nokleberg
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.servlet.ScopingException -->
@@ -6620,7 +7222,8 @@
<![CDATA[Annotates a {@link GuiceFilter} that provides scope functionality, but
doesn't dispatch to {@link ServletModule} bound servlets or filters.
- @author iqshum@google.com (Isaac Shum)]]>
+ @author iqshum@google.com (Isaac Shum)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.servlet.ScopingOnly -->
@@ -6854,7 +7457,7 @@
@since 2.0]]>
</doc>
</method>
- <method name="getServletContext" return="ServletContext"
+ <method name="getServletContext" return="javax.servlet.ServletContext"
abstract="false" native="false" synchronized="false"
static="false" final="true" visibility="protected"
deprecated="not deprecated">
@@ -6886,19 +7489,19 @@
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filterKey" type="java.lang.Class&lt;? extends Filter&gt;"/>
+ <param name="filterKey" type="java.lang.Class&lt;? extends javax.servlet.Filter&gt;"/>
</method>
<method name="through"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filterKey" type="com.google.inject.Key&lt;? extends Filter&gt;"/>
+ <param name="filterKey" type="com.google.inject.Key&lt;? extends javax.servlet.Filter&gt;"/>
</method>
<method name="through"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filter" type="Filter"/>
+ <param name="filter" type="javax.servlet.Filter"/>
<doc>
<![CDATA[@since 3.0]]>
</doc>
@@ -6907,21 +7510,21 @@
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filterKey" type="java.lang.Class&lt;? extends Filter&gt;"/>
+ <param name="filterKey" type="java.lang.Class&lt;? extends javax.servlet.Filter&gt;"/>
<param name="initParams" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;"/>
</method>
<method name="through"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filterKey" type="com.google.inject.Key&lt;? extends Filter&gt;"/>
+ <param name="filterKey" type="com.google.inject.Key&lt;? extends javax.servlet.Filter&gt;"/>
<param name="initParams" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;"/>
</method>
<method name="through"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="filter" type="Filter"/>
+ <param name="filter" type="javax.servlet.Filter"/>
<param name="initParams" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;"/>
<doc>
<![CDATA[@since 3.0]]>
@@ -6942,19 +7545,19 @@
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletKey" type="java.lang.Class&lt;? extends HttpServlet&gt;"/>
+ <param name="servletKey" type="java.lang.Class&lt;? extends javax.servlet.http.HttpServlet&gt;"/>
</method>
<method name="with"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletKey" type="com.google.inject.Key&lt;? extends HttpServlet&gt;"/>
+ <param name="servletKey" type="com.google.inject.Key&lt;? extends javax.servlet.http.HttpServlet&gt;"/>
</method>
<method name="with"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servlet" type="HttpServlet"/>
+ <param name="servlet" type="javax.servlet.http.HttpServlet"/>
<doc>
<![CDATA[@since 3.0]]>
</doc>
@@ -6963,21 +7566,21 @@
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletKey" type="java.lang.Class&lt;? extends HttpServlet&gt;"/>
+ <param name="servletKey" type="java.lang.Class&lt;? extends javax.servlet.http.HttpServlet&gt;"/>
<param name="initParams" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;"/>
</method>
<method name="with"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servletKey" type="com.google.inject.Key&lt;? extends HttpServlet&gt;"/>
+ <param name="servletKey" type="com.google.inject.Key&lt;? extends javax.servlet.http.HttpServlet&gt;"/>
<param name="initParams" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;"/>
</method>
<method name="with"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="servlet" type="HttpServlet"/>
+ <param name="servlet" type="javax.servlet.http.HttpServlet"/>
<param name="initParams" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;"/>
<doc>
<![CDATA[@since 3.0]]>
@@ -7158,22 +7761,18 @@
where you can detach the request processing thread while waiting for data,
and reattach to a different thread to finish processing at a later time.
- <p>Because {@code HttpServletRequest} objects are not typically
- thread-safe, the callable returned by this method must not be run on a
- different thread until the current request scope has terminated. In other
- words, do not use this method to propagate the current request scope to
- worker threads that may run concurrently with the current thread.
-
- <p>The returned callable will throw a {@link ScopingException} when called
- if the request scope being transferred is still active on a different
- thread.
+ <p>Because request-scoped objects are not typically thread-safe, the
+ callable returned by this method must not be run on a different thread
+ until the current request scope has terminated. The returned callable will
+ block until the current thread has released the request scope.
@param callable code to be executed in another thread, which depends on
the request scope.
@return a callable that will invoke the given callable, making the request
context available to it.
@throws OutOfScopeException if this method is called from a non-request
- thread, or if the request has completed.]]>
+ thread, or if the request has completed.
+ @since 4.0]]>
</doc>
</method>
<method name="isRequestScoped" return="boolean"
@@ -7186,7 +7785,9 @@
{@link com.google.inject.spi.LinkedKeyBinding linked key binding} and
belongs to an injector (i. e. it was retrieved via
{@link Injector#getBinding Injector.getBinding()}), then this method will
- also return true if the target binding is request-scoped.]]>
+ also return true if the target binding is request-scoped.
+
+ @since 4.0]]>
</doc>
</method>
<method name="scopeRequest" return="java.util.concurrent.Callable&lt;T&gt;"
@@ -7781,6 +8382,12 @@
deprecated="not deprecated">
<param name="option" type="com.google.inject.spi.RequireExactBindingAnnotationsOption"/>
</method>
+ <method name="visit" return="V"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binding" type="com.google.inject.spi.ModuleAnnotatedMethodScannerBinding"/>
+ </method>
<doc>
<![CDATA[No-op visitor for subclassing. All interface methods simply delegate to
{@link #visitOther(Element)}, returning its result.
@@ -7921,7 +8528,8 @@
<![CDATA[A combination of a {@link Dependency} and the {@link Binding#getSource()
source} where the dependency was bound.
- @author sameb@google.com (Sam Berlin)]]>
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.spi.DependencyAndSource -->
@@ -8099,8 +8707,9 @@
deprecated="not deprecated">
<doc>
<![CDATA[Returns a single location in source code that defines the element. It can be any object
- such as {@link Constructor}, {@link Method}, {@link Field}, {@link StackTraceElement}, etc. For
- example, if the element is created from a method annotated by {@literal @Provides}, the
+ such as {@link java.lang.reflect.Constructor}, {@link java.lang.reflect.Method},
+ {@link java.lang.reflect.Field}, {@link StackTraceElement}, etc. For
+ example, if the element is created from a method annotated by {@literal @Provides}, the
declaring source of element would be the method itself.]]>
</doc>
</method>
@@ -8119,9 +8728,9 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
- <![CDATA[Returns the position of {@link Module#configure(Binder) configure(Binder)} method call in the
- {@link #getStackTrace() stack trace} for modules that their classes returned by
- {@link #getModuleClassNames()}. For example, if the stack trace looks like the following:
+ <![CDATA[Returns the position of {@link com.google.inject.Module#configure configure(Binder)} method
+ call in the {@link #getStackTrace stack trace} for modules that their classes returned by
+ {@link #getModuleClassNames}. For example, if the stack trace looks like the following:
<p>
{@code
0 - Binder.bind(),
@@ -8142,12 +8751,12 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
- <![CDATA[Returns the sequence of method calls that ends at one of {@link Binder} {@code bindXXX()}
- methods and eventually defines the element. Note that {@link #getStackTrace()} lists {@link
- StackTraceElement StackTraceElements} in reverse chronological order. The first element (index
- zero) is the last method call and the last element is the first method invocation. In the cases
- where stack trace is not available (i.e.,the stack trace was not collected), it returns an
- empty array.]]>
+ <![CDATA[Returns the sequence of method calls that ends at one of {@link com.google.inject.Binder}
+ {@code bindXXX()} methods and eventually defines the element. Note that
+ {@link #getStackTrace} lists {@link StackTraceElement StackTraceElements} in reverse
+ chronological order. The first element (index zero) is the last method call and the last
+ element is the first method invocation. In the cases where stack trace is not available
+ (i.e.,the stack trace was not collected), it returns an empty array.]]>
</doc>
</method>
<method name="toString" return="java.lang.String"
@@ -8159,29 +8768,38 @@
</doc>
</method>
<doc>
- <![CDATA[Contains information about where and how an {@link Element element} was bound.
- <p>
- The {@link #getDeclaringSource() declaring source} refers to a location in source code that
- defines the Guice {@link Element element}. For example, if the element is created from a method
- annotated by {@literal @Provides}, the declaring source of element would be the method itself.
+ <![CDATA[Contains information about where and how an {@link Element element} was
+ bound.
<p>
- The {@link #getStackTrace()} refers to the sequence of calls ends at one of {@link Binder}
- {@code bindXXX()} methods and eventually defines the element. Note that {@link #getStackTrace()}
- lists {@link StackTraceElement StackTraceElements} in reverse chronological order. The first
- element (index zero) is the last method call and the last element is the first method invocation.
- By default, the stack trace is not collected. The default behavior can be changed by setting the
- {@code guice_include_stack_traces} flag value. The value can be either {@code OFF}, {@code
- ONLY_FOR_DECLARING_SOURCE} or {@code COMPLETE}. Note that collecting stack traces for every
- binding can cause a performance hit when the injector is created.
+ The {@link #getDeclaringSource() declaring source} refers to a location in
+ source code that defines the Guice {@link Element element}. For example, if
+ the element is created from a method annotated by {@literal @Provides}, the
+ declaring source of element would be the method itself.
<p>
- The sequence of class names of {@link Module modules} involved in the element creation can be
- retrieved by {@link #getModuleClassNames()}. Similar to {@link #getStackTrace()}, the order is
- reverse chronological. The first module (index 0) is the module that installs the {@link Element
- element}. The last module is the root module.
+ The {@link #getStackTrace()} refers to the sequence of calls ends at one of
+ {@link com.google.inject.Binder} {@code bindXXX()} methods and eventually
+ defines the element. Note that {@link #getStackTrace()} lists
+ {@link StackTraceElement StackTraceElements} in reverse chronological order.
+ The first element (index zero) is the last method call and the last element
+ is the first method invocation. By default, the stack trace is not collected.
+ The default behavior can be changed by setting the
+ {@code guice_include_stack_traces} flag value. The value can be either
+ {@code OFF}, {@code ONLY_FOR_DECLARING_SOURCE} or {@code COMPLETE}. Note that
+ collecting stack traces for every binding can cause a performance hit when
+ the injector is created.
<p>
- In order to support the cases where a Guice {@link Element element} is created from another
- Guice {@link Element element} (original) (e.g., by {@link Element#applyTo()}), it also
- provides a reference to the original element source ({@link #getOriginalElementSource()}).]]>
+ The sequence of class names of {@link com.google.inject.Module modules}
+ involved in the element creation can be retrieved by
+ {@link #getModuleClassNames()}. Similar to {@link #getStackTrace()}, the
+ order is reverse chronological. The first module (index 0) is the module that
+ installs the {@link Element element}. The last module is the root module.
+ <p>
+ In order to support the cases where a Guice {@link Element element} is
+ created from another Guice {@link Element element} (original) (e.g., by
+ {@link Element#applyTo}), it also provides a reference to the original
+ element source ({@link #getOriginalElementSource()}).
+
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.spi.ElementSource -->
@@ -8296,7 +8914,9 @@
deprecated="not deprecated">
<param name="binding" type="com.google.inject.spi.ProvisionListenerBinding"/>
<doc>
- <![CDATA[Visit a provision listener binding.]]>
+ <![CDATA[Visit a provision listener binding.
+
+ @since 4.0]]>
</doc>
</method>
<method name="visit" return="V"
@@ -8343,6 +8963,17 @@
@since 4.0]]>
</doc>
</method>
+ <method name="visit" return="V"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binding" type="com.google.inject.spi.ModuleAnnotatedMethodScannerBinding"/>
+ <doc>
+ <![CDATA[Visits a {@link Binder#scanModulesForAnnotatedMethods} command.
+
+ @since 4.0]]>
+ </doc>
+ </method>
<doc>
<![CDATA[Visit elements.
@@ -8568,6 +9199,23 @@
parameter with multiple binding annotations.]]>
</doc>
</method>
+ <method name="forMethod" return="com.google.inject.spi.InjectionPoint"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="method" type="java.lang.reflect.Method"/>
+ <param name="type" type="com.google.inject.TypeLiteral&lt;T&gt;"/>
+ <doc>
+ <![CDATA[Returns a new injection point for the specified method of {@code type}.
+ This is useful for extensions that need to build dependency graphs from
+ arbitrary methods.
+
+ @param method any single method present on {@code type}.
+ @param type the concrete type that defines {@code method}.
+
+ @since 4.0]]>
+ </doc>
+ </method>
<method name="forStaticMethodsAndFields" return="java.util.Set&lt;com.google.inject.spi.InjectionPoint&gt;"
abstract="false" native="false" synchronized="false"
static="true" final="false" visibility="public"
@@ -9011,6 +9659,99 @@
</doc>
</class>
<!-- end class com.google.inject.spi.Message -->
+ <!-- start class com.google.inject.spi.ModuleAnnotatedMethodScanner -->
+ <class name="ModuleAnnotatedMethodScanner" extends="java.lang.Object"
+ abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <constructor name="ModuleAnnotatedMethodScanner"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ </constructor>
+ <method name="annotationClasses" return="java.util.Set&lt;? extends java.lang.Class&lt;? extends java.lang.annotation.Annotation&gt;&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns the annotations this should scan for. Every method in the module that has one of these
+ annotations will create a Provider binding, with the return value of the binding being what's
+ provided and the parameters of the method being dependencies of the provider.]]>
+ </doc>
+ </method>
+ <method name="prepareMethod" return="com.google.inject.Key&lt;T&gt;"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
+ <param name="annotation" type="java.lang.annotation.Annotation"/>
+ <param name="key" type="com.google.inject.Key&lt;T&gt;"/>
+ <param name="injectionPoint" type="com.google.inject.spi.InjectionPoint"/>
+ <doc>
+ <![CDATA[Prepares a method for binding. This {@code key} parameter is the key discovered from looking at
+ the binding annotation and return value of the method. Implementations can modify the key to
+ instead bind to another key. For example, Multibinder may want to change
+ {@code @SetProvides String provideFoo()} to bind into a unique Key within the multibinder
+ instead of binding {@code String}.
+
+ <p>The injection point and annotation are provided in case the implementation wants to set the
+ key based on the property of the annotation or if any additional preparation is needed for any
+ of the dependencies. The annotation is guaranteed to be an instance of one the classes returned
+ by {@link #annotationClasses}.]]>
+ </doc>
+ </method>
+ <doc>
+ <![CDATA[Allows extensions to scan modules for annotated methods and bind those methods
+ as providers, similar to {@code @Provides} methods.
+
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.spi.ModuleAnnotatedMethodScanner -->
+ <!-- start class com.google.inject.spi.ModuleAnnotatedMethodScannerBinding -->
+ <class name="ModuleAnnotatedMethodScannerBinding" extends="java.lang.Object"
+ abstract="false"
+ static="false" final="true" visibility="public"
+ deprecated="not deprecated">
+ <implements name="com.google.inject.spi.Element"/>
+ <constructor name="ModuleAnnotatedMethodScannerBinding" type="java.lang.Object, com.google.inject.spi.ModuleAnnotatedMethodScanner"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ </constructor>
+ <method name="getSource" return="java.lang.Object"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ </method>
+ <method name="getScanner" return="com.google.inject.spi.ModuleAnnotatedMethodScanner"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ </method>
+ <method name="acceptVisitor" return="T"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="visitor" type="com.google.inject.spi.ElementVisitor&lt;T&gt;"/>
+ </method>
+ <method name="applyTo"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
+ </method>
+ <method name="toString" return="java.lang.String"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ </method>
+ <doc>
+ <![CDATA[Represents a call to {@link Binder#scanModulesForAnnotatedMethods} in a module.
+
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.spi.ModuleAnnotatedMethodScannerBinding -->
<!-- start interface com.google.inject.spi.PrivateElements -->
<interface name="PrivateElements" abstract="true"
static="false" final="false" visibility="public"
@@ -9112,7 +9853,8 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
- <![CDATA[Returns the user-supplied, unscoped provider.]]>
+ <![CDATA[Returns the user-supplied, unscoped provider.
+ @since 4.0]]>
</doc>
</method>
<method name="getInjectionPoints" return="java.util.Set&lt;com.google.inject.spi.InjectionPoint&gt;"
@@ -9169,6 +9911,13 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
</constructor>
+ <constructor name="ProviderLookup" type="java.lang.Object, com.google.inject.spi.Dependency&lt;T&gt;"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
+ </constructor>
<method name="getSource" return="java.lang.Object"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
@@ -9179,6 +9928,14 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
</method>
+ <method name="getDependency" return="com.google.inject.spi.Dependency&lt;T&gt;"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
+ </method>
<method name="acceptVisitor" return="T"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
@@ -9325,9 +10082,21 @@
<![CDATA[Returns the key of the binding.]]>
</doc>
</method>
+ <method name="getAnnotation" return="java.lang.annotation.Annotation"
+ abstract="true" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <doc>
+ <![CDATA[Returns the annotation that caused this binding to be created. For {@code @Provides} methods,
+ this is an instance of the {@code @Provides} annotation. For bindings from
+ {@link ModuleAnnotatedMethodScanner}, this is the annotation that caused the scanner to produce
+ the binding.]]>
+ </doc>
+ </method>
<doc>
- <![CDATA[An {@literal @}{@link Provides} binding.
-
+ <![CDATA[An {@literal @}{@link Provides} binding or binding produced by a
+ {@link ModuleAnnotatedMethodScanner}.
+
@since 4.0
@author sameb@google.com (Sam Berlin)]]>
</doc>
@@ -9430,7 +10199,9 @@
</doc>
</method>
<doc>
- <![CDATA[Encapsulates a single act of provisioning.]]>
+ <![CDATA[Encapsulates a single act of provisioning.
+
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.spi.ProvisionListener.ProvisionInvocation -->
@@ -9832,7 +10603,7 @@
<param name="type" type="java.lang.Class&lt;T&gt;"/>
<doc>
<![CDATA[Returns the provider used to obtain instances for the given injection type. The returned
- provider will not be valid until the injetor has been created. The provider will throw an
+ provider will not be valid until the injector has been created. The provider will throw an
{@code IllegalStateException} if you try to use it beforehand.]]>
</doc>
</method>
@@ -10046,7 +10817,7 @@
static="true" final="false" visibility="public"
deprecated="not deprecated">
<param name="binder" type="com.google.inject.Binder"/>
- <param name="beanFactory" type="ListableBeanFactory"/>
+ <param name="beanFactory" type="org.springframework.beans.factory.ListableBeanFactory"/>
<doc>
<![CDATA[Binds all Spring beans from the given factory by name. For a Spring bean
named "foo", this method creates a binding to the bean's type and
@@ -10066,10 +10837,10 @@
</package>
<package name="com.google.inject.struts2">
<!-- start class com.google.inject.struts2.GuiceObjectFactory -->
- <class name="GuiceObjectFactory" extends="ObjectFactory"
+ <class name="GuiceObjectFactory" extends="com.opensymphony.xwork2.ObjectFactory"
abstract="false"
static="false" final="false" visibility="public"
- deprecated="Use {@link com.google.inject.servlet.Struts2Factory} instead.">
+ deprecated="Use {@link com.google.inject.struts2.Struts2Factory} instead.">
<constructor name="GuiceObjectFactory"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -10093,21 +10864,21 @@
<param name="clazz" type="java.lang.Class"/>
<param name="extraContext" type="java.util.Map"/>
</method>
- <method name="buildInterceptor" return="Interceptor"
+ <method name="buildInterceptor" return="com.opensymphony.xwork2.interceptor.Interceptor"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="interceptorConfig" type="InterceptorConfig"/>
+ <param name="interceptorConfig" type="com.opensymphony.xwork2.config.entities.InterceptorConfig"/>
<param name="interceptorRefParams" type="java.util.Map"/>
- <exception name="ConfigurationException" type="ConfigurationException"/>
+ <exception name="ConfigurationException" type="com.opensymphony.xwork2.config.ConfigurationException"/>
</method>
<doc>
- <![CDATA[@deprecated Use {@link com.google.inject.servlet.Struts2Factory} instead.]]>
+ <![CDATA[@deprecated Use {@link com.google.inject.struts2.Struts2Factory} instead.]]>
</doc>
</class>
<!-- end class com.google.inject.struts2.GuiceObjectFactory -->
<!-- start class com.google.inject.struts2.Struts2Factory -->
- <class name="Struts2Factory" extends="ObjectFactory"
+ <class name="Struts2Factory" extends="com.opensymphony.xwork2.ObjectFactory"
abstract="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
@@ -10134,13 +10905,13 @@
<param name="clazz" type="java.lang.Class"/>
<param name="extraContext" type="java.util.Map&lt;java.lang.String, java.lang.Object&gt;"/>
</method>
- <method name="buildInterceptor" return="Interceptor"
+ <method name="buildInterceptor" return="com.opensymphony.xwork2.interceptor.Interceptor"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
- <param name="interceptorConfig" type="InterceptorConfig"/>
+ <param name="interceptorConfig" type="com.opensymphony.xwork2.config.entities.InterceptorConfig"/>
<param name="interceptorRefParams" type="java.util.Map"/>
- <exception name="ConfigurationException" type="ConfigurationException"/>
+ <exception name="ConfigurationException" type="com.opensymphony.xwork2.config.ConfigurationException"/>
</method>
<doc>
<![CDATA[Cleanup up version from Bob's GuiceObjectFactory. Now works properly with
@@ -10166,15 +10937,118 @@
deprecated="not deprecated">
</method>
<doc>
- <![CDATA[Initializes the Struts 2 Guice Plugin.
- Must be added to the injector returned by
- {@link GuiceServletContextListener.getInjector()}.
+ <![CDATA[Initializes the Struts 2 Guice Plugin. Must be added to the injector returned
+ by {@link com.google.inject.servlet.GuiceServletContextListener#getInjector}.
@author benmccann.com]]>
</doc>
</class>
<!-- end class com.google.inject.struts2.Struts2GuicePluginModule -->
</package>
+<package name="com.google.inject.testing.fieldbinder">
+ <!-- start class com.google.inject.testing.fieldbinder.Bind -->
+ <class name="Bind" abstract="true"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <implements name="java.lang.annotation.Annotation"/>
+ <doc>
+ <![CDATA[Annotation used by {@link BoundFieldModule} to indicate that a field should be bound to its
+ value using Guice.
+
+ @see BoundFieldModule
+ @author eatnumber1@google.com (Russ Harmon)]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.testing.fieldbinder.Bind -->
+ <!-- start class com.google.inject.testing.fieldbinder.BoundFieldModule -->
+ <class name="BoundFieldModule" extends="java.lang.Object"
+ abstract="false"
+ static="false" final="true" visibility="public"
+ deprecated="not deprecated">
+ <implements name="com.google.inject.Module"/>
+ <method name="of" return="com.google.inject.testing.fieldbinder.BoundFieldModule"
+ abstract="false" native="false" synchronized="false"
+ static="true" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="instance" type="java.lang.Object"/>
+ <doc>
+ <![CDATA[Create a BoundFieldModule which binds the {@link Bind} annotated fields of {@code instance}.
+
+ @param instance the instance whose fields will be bound.
+ @return a module which will bind the {@link Bind} annotated fields of {@code instance}.]]>
+ </doc>
+ </method>
+ <method name="configure"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="binder" type="com.google.inject.Binder"/>
+ </method>
+ <doc>
+ <![CDATA[Automatically creates Guice bindings for fields in an object annotated with {@link Bind}.
+
+ <p>This module is intended for use in tests to reduce the code needed to bind local fields
+ (usually mocks) for injection.
+
+ <p>The following rules are followed in determining how fields are bound using this module:
+
+ <ul>
+ <li>
+ For each {@link Bind} annotated field of an object and its superclasses, this module will bind
+ that field's type to that field's value at injector creation time. This includes both instance
+ and static fields.
+ </li>
+ <li>
+ If {@link Bind#to} is specified, the field's value will be bound to the class specified by
+ {@link Bind#to} instead of the field's actual type.
+ </li>
+ <li>
+ If a {@link BindingAnnotation} or {@link javax.inject.Qualifier} is present on the field,
+ that field will be bound using that annotation via {@link AnnotatedBindingBuilder#annotatedWith}.
+ For example, {@code bind(Foo.class).annotatedWith(BarAnnotation.class).toInstance(theValue)}.
+ It is an error to supply more than one {@link BindingAnnotation} or
+ {@link javax.inject.Qualifier}.
+ </li>
+ <li>
+ If the field is of type {@link Provider}, the field's value will be bound as a {@link Provider}
+ using {@link LinkedBindingBuilder#toProvider} to the provider's parameterized type. For example,
+ {@code Provider<Integer>} binds to {@link Integer}. Attempting to bind a non-parameterized
+ {@link Provider} without a {@link Bind#to} clause is an error.
+ </li>
+ </ul>
+
+ <p>Example use:
+ <pre><code>
+ public class TestFoo {
+ // bind(new TypeLiteral{@code <List<Object>>}() {}).toInstance(listOfObjects);
+ {@literal @}Bind private List{@code <Object>} listOfObjects = Lists.of();
+
+ // bind(String.class).toProvider(new Provider() { public String get() { return userName; }});
+ {@literal @}Bind(lazy = true) private String userName;
+
+ // bind(SuperClass.class).toInstance(aSubClass);
+ {@literal @}Bind(to = SuperClass.class) private SubClass aSubClass = new SubClass();
+
+ // bind(Object.class).annotatedWith(MyBindingAnnotation.class).toInstance(object2);
+ {@literal @}Bind
+ {@literal @}MyBindingAnnotation
+ private String myString = "hello";
+
+ // bind(Object.class).toProvider(myProvider);
+ {@literal @}Bind private Provider{@code <Object>} myProvider = getProvider();
+
+ {@literal @}Before public void setUp() {
+ Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
+ }
+ }
+ </code></pre>
+
+ @see Bind
+ @author eatnumber1@google.com (Russ Harmon)]]>
+ </doc>
+ </class>
+ <!-- end class com.google.inject.testing.fieldbinder.BoundFieldModule -->
+</package>
<package name="com.google.inject.throwingproviders">
<!-- start interface com.google.inject.throwingproviders.CheckedProvider -->
<interface name="CheckedProvider" abstract="true"
@@ -10212,11 +11086,11 @@
deprecated="not deprecated">
<implements name="java.lang.annotation.Annotation"/>
<doc>
- <![CDATA[Annotates methods of a {@link Module} to create a {@link CheckedProvider}
- method binding that can throw exceptions. The method's return type is bound
- to a {@link CheckedProvider} that can be injected. Guice will pass
- dependencies to the method as parameters. Install {@literal @}CheckedProvides
- methods by using
+ <![CDATA[Annotates methods of a {@link com.google.inject.Module} to create a
+ {@link CheckedProvider} method binding that can throw exceptions. The
+ method's return type is bound to a {@link CheckedProvider} that can be
+ injected. Guice will pass dependencies to the method as parameters. Install
+ {@literal @}CheckedProvides methods by using
{@link ThrowingProviderBinder#forModule(com.google.inject.Module)} on the
module where the methods are declared.
@@ -10238,7 +11112,8 @@
</code></pre>
where CustomerImpl has a constructor annotated with ThrowingInject.
- @author sameb@google.com (Sam Berlin)]]>
+ @author sameb@google.com (Sam Berlin)
+ @since 4.0]]>
</doc>
</class>
<!-- end class com.google.inject.throwingproviders.ThrowingInject -->
@@ -10311,6 +11186,9 @@
deprecated="not deprecated">
<param name="interfaceType" type="java.lang.Class&lt;P&gt;"/>
<param name="clazz" type="java.lang.Class&lt;T&gt;"/>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="bind" return="com.google.inject.throwingproviders.ThrowingProviderBinder.SecondaryBinder&lt;P, T&gt;"
abstract="false" native="false" synchronized="false"
@@ -10318,6 +11196,9 @@
deprecated="not deprecated">
<param name="interfaceType" type="java.lang.Class&lt;P&gt;"/>
<param name="typeLiteral" type="com.google.inject.TypeLiteral&lt;T&gt;"/>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<doc>
<![CDATA[<p>Builds a binding for a {@link CheckedProvider}.
@@ -10376,6 +11257,18 @@
deprecated="not deprecated">
<param name="annotation" type="java.lang.annotation.Annotation"/>
</method>
+ <method name="scopeExceptions" return="com.google.inject.throwingproviders.ThrowingProviderBinder.SecondaryBinder&lt;P, T&gt;"
+ abstract="false" native="false" synchronized="false"
+ static="false" final="false" visibility="public"
+ deprecated="not deprecated">
+ <param name="scopeExceptions" type="boolean"/>
+ <doc>
+ <![CDATA[Determines if exceptions should be scoped. By default exceptions are scoped.
+
+ @param scopeExceptions whether exceptions should be scoped.
+ @since 4.0]]>
+ </doc>
+ </method>
<method name="to" return="com.google.inject.binder.ScopedBindingBuilder"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
@@ -10393,12 +11286,18 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="cxtorClass" type="java.lang.Class&lt;? extends T&gt;"/>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="providing" return="com.google.inject.binder.ScopedBindingBuilder"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="cxtorLiteral" type="com.google.inject.TypeLiteral&lt;? extends T&gt;"/>
+ <doc>
+ <![CDATA[@since 4.0]]>
+ </doc>
</method>
<method name="to" return="com.google.inject.binder.ScopedBindingBuilder"
abstract="false" native="false" synchronized="false"