You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2009/10/30 12:52:51 UTC
svn commit: r831276 - in /incubator/openwebbeans/trunk:
webbeans-api/src/main/java/javax/enterprise/inject/New.java
webbeans-impl/src/main/java/org/apache/webbeans/annotation/NewLiteral.java
Author: struberg
Date: Fri Oct 30 11:52:50 2009
New Revision: 831276
URL: http://svn.apache.org/viewvc?rev=831276&view=rev
Log:
[OWB-152] create Class<?> value for @New fixed in the @interface and Literal
This still needs to be evaluated in the DI container though!
Modified:
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/New.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/NewLiteral.java
Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/New.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/New.java?rev=831276&r1=831275&r2=831276&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/New.java (original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/New.java Fri Oct 30 11:52:50 2009
@@ -35,5 +35,10 @@
@Qualifier
public @interface New
{
-
+ /**
+ * May be used to declare which type should be used for injection.
+ * This defaults to the type which is defined at the injection point.
+ * @return the class of the bean which should be injected
+ */
+ Class<?> value() default New.class;
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/NewLiteral.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/NewLiteral.java?rev=831276&r1=831275&r2=831276&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/NewLiteral.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/annotation/NewLiteral.java Fri Oct 30 11:52:50 2009
@@ -28,7 +28,7 @@
public NewLiteral()
{
-
+ this.clazz = New.class;
}
public NewLiteral(Class<?> clazz)
@@ -36,5 +36,11 @@
this.clazz = clazz;
}
+ /** {@inheritDoc} */
+ @Override
+ public Class<?> value() {
+ return clazz;
+ }
+
}