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 README to provide doc for InjectSPI #594

Merged
merged 1 commit into from
Jun 6, 2024
Merged
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ Example ex = beanScope.get(Example.class);
### Java Module Usage
When working with Java modules you need to add a `provides` statement in your `module-info.java` with the generated class.
```java
import io.avaje.inject.spi.Module;
import io.avaje.inject.spi.InjectSPI;

module org.example {

requires io.avaje.inject;
// you must define the fully qualified class name of the generated classes. if you use an import statement, compilation will fail
provides Module with org.example.ExampleModule;
provides InjectSPI with org.example.ExampleModule;
}
```

### Generated Wiring Class
The inject annotation processor determines the dependency wiring order and generates a `Module` class that calls all the generated DI classes.
The inject annotation processor determines the dependency wiring order and generates an `AvajeModule` class that calls all the generated DI classes.

```java
@Generated("io.avaje.inject.generator")
@InjectModule
public final class ExampleModule implements Module {
public final class ExampleModule implements AvajeModule {

private Builder builder;

Expand Down
Loading