From 60ee76710fb0426695824861e60a1d7c9eb54196 Mon Sep 17 00:00:00 2001 From: Bob Lee Date: Sat, 3 Oct 2009 15:10:49 +0000 Subject: Made rule about injecting T or a subtype of T more precise. git-svn-id: https://atinject.googlecode.com/svn/trunk@50 3bc8319c-20ab-11de-9edc-3f40a397ab60 --- atinject.ipr | 5 ++++- src/javax/inject/Inject.java | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/atinject.ipr b/atinject.ipr index 716284b..5caf3de 100644 --- a/atinject.ipr +++ b/atinject.ipr @@ -223,7 +223,7 @@ - @@ -252,6 +252,9 @@ + + + diff --git a/src/javax/inject/Inject.java b/src/javax/inject/Inject.java index 7dc7b76..29e431b 100644 --- a/src/javax/inject/Inject.java +++ b/src/javax/inject/Inject.java @@ -31,10 +31,6 @@ import static java.lang.annotation.ElementType.FIELD; * injected first, followed by fields, and then methods. Fields and methods * in superclasses are injected before those in subclasses. Ordering of * injection among fields and among methods in the same class is not specified. - * For a given type T and optional qualifier, an injector must - * be able to inject a user-specified subtype of T that has an injectable - * constructor. Beyond that, which values are injected depend upon the - * injector implementation and its configuration. * *

Injectable constructors are annotated with {@code @Inject} and accept * zero or more dependencies as arguments. {@code @Inject} can apply to at most @@ -89,7 +85,7 @@ import static java.lang.annotation.ElementType.FIELD; * non-{@code void} return types are allowed to support use of the method in * other contexts (builder-style method chaining, for example). * - *

For example: + *

Examples: * *

  *   public class Car {
@@ -115,6 +111,17 @@ import static java.lang.annotation.ElementType.FIELD;
  * restrictions or lack of reflection support) might preclude injection
  * of non-public members.
  *
+ * 

For a given type T and optional qualifier, an injector must be able to + * inject a user-specified class that: + * + *

    + *
  1. is assignment compatible with T and
  2. + *
  3. has an injectable constructor.
  4. + *
+ * + *

Beyond that, which values are injected depend upon the injector + * implementation and its configuration. + * *

Qualifiers

* *

A {@linkplain Qualifier qualifier} may annotate an injectable field -- cgit v1.2.3