Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update javadoc of inject and provides #58

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion simple-component/src/main/java/io/jbock/simple/Inject.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Identifies injectable constructors and <em>static</em> methods.
* Identifies injectable constructors and {@code static} methods.
* An {@code @Inject}-annotated static method is allowed in the following places:
*
* <ul>
* <li>The method can be a direct child of the class or interface
* that defines its return type.
* <li>If the class or interface that defines its return type is nested
* inside an enclosing class, then the method may also be a direct child of the
* enclosing class.
* <li>The method can be a direct child of the component interface.
* Alternatively, the {@link Provides} annotation can be used in that case.
* </ul>
*/
@Target({METHOD, CONSTRUCTOR})
@Retention(RUNTIME)
Expand Down
4 changes: 2 additions & 2 deletions simple-component/src/main/java/io/jbock/simple/Provides.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
* This is an alternative to the {@code @Inject} annotation
* which can only be used on static methods directly in the component.
* An alternative to the {@code @Inject} annotation that can be used
* on static methods which are direct children of the component interface.
*/
@Target(METHOD)
@Retention(SOURCE)
Expand Down
Loading