[weld-commits] Weld SVN: r4242 - api/trunk/cdi/src/main/java/javax/enterprise/inject.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Fri Oct 23 15:29:54 EDT 2009


Author: gavin.king at jboss.com
Date: 2009-10-23 15:29:54 -0400 (Fri, 23 Oct 2009)
New Revision: 4242

Modified:
   api/trunk/cdi/src/main/java/javax/enterprise/inject/New.java
Log:
javadoc for @New

Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/New.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/New.java	2009-10-23 19:20:15 UTC (rev 4241)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/New.java	2009-10-23 19:29:54 UTC (rev 4242)
@@ -30,8 +30,31 @@
 import javax.inject.Qualifier;
 
 /**
- * The special binding type.
+ * <p>The built-in qualifier type.</p>
  * 
+ * <p>This allows the application to obtain a new instance of a bean which is
+ * not bound to the declared scope, but has had dependency injection performed.</p>
+ *
+ * <pre>
+ * &#064;Produces &#064;ConversationScoped 
+ * &#064;Special Order getSpecialOrder(&#064;New(Order.class) Order order) {
+ *    ...
+ *    return order;
+ * }
+ * </pre>
+ *    
+ * <p>When the qualifier {@link javax.enterprise.inject.New &#064;New} is specified 
+ * at an injection point and no {@link javax.enterprise.inject.New#value() value} 
+ * member is explicitly specified, the container defaults the 
+ * {@link javax.enterprise.inject.New#value() value} to the declared type of the 
+ * injection point. So the following injection point has qualifier
+ * <tt>&#064;New(Order.class)</tt>:</p>
+ * 
+ * <pre>
+ * &#064;Produces &#064;ConversationScoped 
+ * &#064;Special Order getSpecialOrder(&#064;New Order order) { ... }
+ * </pre>
+ *
  * @author Gavin King
  * @author Pete Muir
  */
@@ -42,7 +65,9 @@
 @Qualifier
 public @interface New
 {
-   
+   /**
+    * @return the bean class of the bean to be injected
+    */
    Class<?> value() default New.class;
    
 }



More information about the weld-commits mailing list