Skip to content

Commit 8d07f20

Browse files
committed
rename
1 parent 9da2811 commit 8d07f20

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected void addImports(boolean withSingleton) {
6767
importTypes.add(Constants.VALIDATOR);
6868
}
6969
if (withSingleton) {
70-
if (ctx.isAvajeAvailable()) {
70+
if (ctx.useComponent()) {
7171
importTypes.add(Constants.COMPONENT);
7272
} else {
7373
importTypes.add(ctx.useJavax() ? Constants.SINGLETON_JAVAX : Constants.SINGLETON_JAKARTA);

http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class ProcessingContext {
2727
private final Types types;
2828
private final boolean openApiAvailable;
2929
private final DocContext docContext;
30-
private final boolean avajeAvailable;
30+
private final boolean useComponent;
3131
private final boolean useJavax;
32-
private final String diAnnotation;
32+
private final String annotationDI;
3333

3434
public ProcessingContext(ProcessingEnvironment env, PlatformAdapter readAdapter) {
3535
this.readAdapter = readAdapter;
@@ -38,11 +38,10 @@ public ProcessingContext(ProcessingEnvironment env, PlatformAdapter readAdapter)
3838
this.elements = env.getElementUtils();
3939
this.types = env.getTypeUtils();
4040
this.openApiAvailable = isTypeAvailable(Constants.OPENAPIDEFINITION);
41-
this.avajeAvailable = isTypeAvailable(Constants.COMPONENT);
42-
this.diAnnotation = avajeAvailable ? "@Component" : "@Singleton";
43-
4441
this.docContext = new DocContext(env, openApiAvailable);
45-
42+
this.useComponent = isTypeAvailable(Constants.COMPONENT);
43+
this.annotationDI = useComponent ? "@Component" : "@Singleton";
44+
4645
final var javax = isTypeAvailable(Constants.SINGLETON_JAVAX);
4746
final var jakarta = isTypeAvailable(Constants.SINGLETON_JAKARTA);
4847
final var override = Boolean.getBoolean(env.getOptions().get("useJavax"));
@@ -72,8 +71,8 @@ public boolean useJavax() {
7271
return useJavax;
7372
}
7473

75-
public boolean isAvajeAvailable() {
76-
return avajeAvailable;
74+
public boolean useComponent() {
75+
return useComponent;
7776
}
7877

7978
public void logError(Element e, String msg, Object... args) {
@@ -114,7 +113,7 @@ public PlatformAdapter platform() {
114113
return readAdapter;
115114
}
116115

117-
public String getDiAnnotation() {
118-
return diAnnotation;
116+
public String getDIAnnotation() {
117+
return annotationDI;
119118
}
120119
}

http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private void writeRoutes(List<ControllerMethodWriter> methods) {
6060

6161
private void writeClassStart() {
6262
writer.append(AT_GENERATED).eol();
63-
writer.append(ctx.getDiAnnotation()).eol();
63+
writer.append(ctx.getDIAnnotation()).eol();
6464
writer.append("public class ").append(shortName).append("$Route implements Service {").eol().eol();
6565

6666
String controllerName = "controller";

http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private void writeForMethod(MethodReader method) {
6767

6868
private void writeClassStart() {
6969
writer.append(AT_GENERATED).eol();
70-
writer.append(ctx.getDiAnnotation()).eol();
70+
writer.append(ctx.getDIAnnotation()).eol();
7171
writer
7272
.append("public class ")
7373
.append(shortName)

http-generator-nima/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void writeRoutes(List<ControllerMethodWriter> methods) {
7777

7878
private void writeClassStart() {
7979
writer.append(AT_GENERATED).eol();
80-
writer.append(ctx.getDiAnnotation()).eol();
80+
writer.append(ctx.getDIAnnotation()).eol();
8181
writer.append("public class %s$Route implements HttpService {", shortName).eol().eol();
8282

8383
var controllerName = "controller";

0 commit comments

Comments
 (0)