Author: gavin.king(a)jboss.com
Date: 2009-10-26 17:58:32 -0400 (Mon, 26 Oct 2009)
New Revision: 4342
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/AnnotationLiteral.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/TypeLiteral.java
Log:
doc helpers
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/AnnotationLiteral.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/AnnotationLiteral.java 2009-10-26
20:03:04 UTC (rev 4341)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/AnnotationLiteral.java 2009-10-26
21:58:32 UTC (rev 4342)
@@ -26,13 +26,32 @@
/**
- * Supports inline instantiation of annotation type instances.
+ * <p>Supports inline instantiation of annotation type instances.</p>
*
+ * <p>An instance of an annotation type may be obtained by subclassing
+ * <tt>AnnotationLiteral</tt>.</p>
+ *
+ * <pre>
+ * public abstract class PayByQualifier
+ * extends AnnotationLiteral<PayBy>
+ * implements PayBy {}
+ * </pre>
+ *
+ * <pre>
+ * PayBy payby = new PayByQualifier() { public value() { return CHEQUE; } };
+ * </pre>
+ *
+ * <p>Annotation values are often passed to APIs that perform typesafe
+ * resolution.</p>
+ *
* @author Pete Muir
* @author Gavin King
*
- * @param <T>
- * the annotation type
+ * @param <T> the annotation type
+ *
+ * @see javax.enterprise.inject.Instance#select(Annotation...)
+ * @see javax.enterprise.event.Event#select(Annotation...)
+ *
*/
public abstract class AnnotationLiteral<T extends Annotation> implements
Annotation
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/TypeLiteral.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/TypeLiteral.java 2009-10-26
20:03:04 UTC (rev 4341)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/TypeLiteral.java 2009-10-26
21:58:32 UTC (rev 4342)
@@ -22,14 +22,26 @@
import java.lang.reflect.Type;
/**
- * Supports inline instantiation of objects that represent parameterized types
- * with actual type parameters.
+ * <p>Supports inline instantiation of objects that represent parameterized types
+ * with actual type parameters.</p>
*
+ * <p>An object that represents any parameterized type may be obtained by
+ * subclassing <tt>TypeLiteral</tt>.
+ *
+ * <pre>
+ * TypeLiteral<List<String>> type = new
TypeLiteral<List<String>>() {};
+ * </pre>
+ *
+ * <p>This object may be passed to APIs that perform typesafe
resolution.</p>
+ *
* @author Gavin King
* @author Pete Muir
*
- * @param <T>
- * the type, including all actual type parameters
+ * @param <T> the type, including all actual type parameters
+ *
+ * @see javax.enterprise.inject.Instance#select(TypeLiteral, Annotation...)
+ * @see javax.enterprise.event.Event#select(TypeLiteral, Annotation...)
+ *
*/
public abstract class TypeLiteral<T>
{