Revision: 1136
Author: dhanji
Date: Mon Jan 4 16:02:57 2010
Log: Javadoc for toConstructor() binding statement.
http://code.google.com/p/google-guice/source/detail?r=1136
Modified:
/trunk/src/com/google/inject/Binder.java
=======================================
--- /trunk/src/com/google/inject/Binder.java Wed Apr 8 15:24:55 2009
+++ /trunk/src/com/google/inject/Binder.java Mon Jan 4 16:02:57 2010
@@ -170,6 +170,17 @@
* names will live in a single flat namespace with all the other names
used in
* your application.
*
+ * <pre>
+ * Constructor<T> loneCtor = getLoneCtorFromServiceImplViaReflection();
+ * bind(ServiceImpl.class)
+ * .toConstructor(loneCtor);</pre>
+ *
+ * In this example, we directly tell Guice which constructor to use in a
concrete
+ * class implementation. It means that we do not need to place {...@literal
@}Inject
+ * on any of the constructors and that Guice treats the provided
constructor as though
+ * it were annotated so. It is useful for cases where you cannot modify
existing
+ * classes and is a bit simpler than using a {...@link Provider}.
+ *
* <p>The above list of examples is far from exhaustive. If you can think
of
* how the concepts of one example might coexist with the concepts from
another,
* you can most likely weave the two together. If the two concepts make no
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.