Author: gavin.king(a)jboss.com
Date: 2009-10-23 13:25:24 -0400 (Fri, 23 Oct 2009)
New Revision: 4239
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/Default.java
Log:
javadoc
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/Default.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/Default.java 2009-10-23 16:52:04
UTC (rev 4238)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/Default.java 2009-10-23 17:25:24
UTC (rev 4239)
@@ -30,9 +30,52 @@
import javax.inject.Qualifier;
/**
- * The default binding type.
+ * <p>The default qualifier.</p>
*
+ * <p>If a bean does not explicitly declare a qualifier other than
+ * {@link javax.inject.Named @Named}, the bean has the qualifier
+ * {@link javax.enterprise.inject.Default @Default}.</p>
+ *
+ * <p>If an injection point declares no qualifier, the injection point
+ * has exactly one qualifier, the default qualifier
+ * {@link javax.enterprise.inject.Default @Default}.</p>
+ *
+ * <p>The following are equivalent:</p>
+ *
+ * <pre>
+ * @ConversationScoped
+ * public class Order {
+ *
+ * private Product product;
+ * private User customer;
+ *
+ * @Inject
+ * public void init(@Selected Product product, User customer) {
+ * this.product = product;
+ * this.customer = customer;
+ * }
+ *
+ * }
+ * </pre>
+ *
+ * <pre>
+ * @Default @ConversationScoped
+ * public class Order {
+ *
+ * private Product product;
+ * private User customer;
+ *
+ * @Inject
+ * public void init(@Selected Product product, @Default User
customer) {
+ * this.product = product;
+ * this.customer = customer;
+ * }
+ *
+ * }
+ * </pre>
+ *
* @author Pete Muir
+ * @author Gavin King
*/
@Target( { TYPE, METHOD, PARAMETER, FIELD })
Show replies by date