Skip to content

Commit 43ab4a9

Browse files
authored
update javadoc of inject and provides (#58)
1 parent 8ea35dd commit 43ab4a9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

simple-component/src/main/java/io/jbock/simple/Inject.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@
88
import static java.lang.annotation.RetentionPolicy.RUNTIME;
99

1010
/**
11-
* Identifies injectable constructors and <em>static</em> methods.
11+
* Identifies injectable constructors and {@code static} methods.
12+
* An {@code @Inject}-annotated static method is allowed in the following places:
13+
*
14+
* <ul>
15+
* <li>The method can be a direct child of the class or interface
16+
* that defines its return type.
17+
* <li>If the class or interface that defines its return type is nested
18+
* inside an enclosing class, then the method may also be a direct child of the
19+
* enclosing class.
20+
* <li>The method can be a direct child of the component interface.
21+
* Alternatively, the {@link Provides} annotation can be used in that case.
22+
* </ul>
1223
*/
1324
@Target({METHOD, CONSTRUCTOR})
1425
@Retention(RUNTIME)

simple-component/src/main/java/io/jbock/simple/Provides.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import static java.lang.annotation.RetentionPolicy.SOURCE;
88

99
/**
10-
* This is an alternative to the {@code @Inject} annotation
11-
* which can only be used on static methods directly in the component.
10+
* An alternative to the {@code @Inject} annotation that can be used
11+
* on static methods which are direct children of the component interface.
1212
*/
1313
@Target(METHOD)
1414
@Retention(SOURCE)

0 commit comments

Comments
 (0)