You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-28Lines changed: 23 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Use source code generation to adapt annotated REST controllers `@Path, @Get, @Po
45
45
</dependency>
46
46
```
47
47
48
-
## Define a Controller (These APT processors work with both Java and Kotlin.)
48
+
## Define a Controller (These APT processors work with Java and Kotlin.)
49
49
```java
50
50
packageorg.example.hello;
51
51
@@ -74,7 +74,7 @@ public class WidgetController {
74
74
}
75
75
```
76
76
## DI Usage
77
-
The annotation processor will generate controller adapters that can register routes to Javalin/Helidon. The natural way to use the generated adapters is to get a DI library to find and wire them. This is what the below examples do and they use [Avaje-Inject](https://avaje.io/inject/) to do this. The AP will automatically detect the presence of avaje-inject and generate the class to use avaje-inject's `@Component` as the DI annotation.
77
+
The annotation processor will generate controller adapters to register routes to Javalin/Helidon. The natural way to use the generated adapters is to get a DI library to find and wire them. This is what the examples below do; they use [Avaje-Inject](https://avaje.io/inject/) to do this. The AP will automatically detect the presence of avaje-inject and generate the class to use avaje-inject's `@Component` as the DI annotation.
78
78
79
79
There isn't a hard requirement to use Avaje for dependency injection. In the absence of avaje-inject, the generated class will use `@jakarta.inject.Singleton` or `@javax.inject.Singleton` depending on what's on the classpath. Any DI library that can find and wire the generated @Singleton beans can be used. You can even use Dagger2 or Guice to wire the controllers if you so desire.
80
80
@@ -93,15 +93,13 @@ To force the AP to generate with `@javax.inject.Singleton`(in the case where you
93
93
94
94
### Usage with Javalin
95
95
96
-
The annotation processor will generate controller classes implementing the WebRoutes interface, which means we can
96
+
The annotation processor will generate controller classes implementing the Javalin `Plugin` interface, which means we can
97
97
get all the WebRoutes and register them with Javalin using:
0 commit comments