Author: gavin.king(a)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>
+ * @Produces @ConversationScoped
+ * @Special Order getSpecialOrder(@New(Order.class) Order order) {
+ * ...
+ * return order;
+ * }
+ * </pre>
+ *
+ * <p>When the qualifier {@link javax.enterprise.inject.New @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>@New(Order.class)</tt>:</p>
+ *
+ * <pre>
+ * @Produces @ConversationScoped
+ * @Special Order getSpecialOrder(@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;
}