Skip to content

Commit af4cf5c

Browse files
committed
#26 - Change the generated code to use Jsonb.GeneratedComponent
1 parent cc19f2a commit af4cf5c

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

jsonb-generator/src/main/java/io/avaje/jsonb/generator/Constants.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
class Constants {
44

5-
//static final String AT_GENERATED = "@Generated(\"io.avaje.inject.generator\")";
6-
static final String META_INF_COMPONENT = "META-INF/services/io.avaje.jsonb.Jsonb$Component";
5+
static final String META_INF_COMPONENT = "META-INF/services/io.avaje.jsonb.Jsonb$GeneratedComponent";
76
static final String JSONB_WILD = "io.avaje.jsonb.*";
87
static final String JSONB_SPI = "io.avaje.jsonb.spi.*";
98
static final String JSONB = "io.avaje.jsonb.Jsonb";

jsonb-generator/src/main/java/io/avaje/jsonb/generator/SimpleComponentWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private void writeClassStart() {
8888
}
8989
writer.append("})").eol();
9090

91-
writer.append("public class %s implements Jsonb.Component {", shortName).eol().eol();
91+
writer.append("public class %s implements Jsonb.GeneratedComponent {", shortName).eol().eol();
9292
}
9393

9494

jsonb-jackson/src/main/java9/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
exports io.avaje.jsonb.jackson;
88

9-
provides io.avaje.jsonb.spi.IOAdapterFactory with io.avaje.jsonb.jackson.JacksonFactory;
9+
provides io.avaje.jsonb.spi.AdapterFactory with io.avaje.jsonb.jackson.JacksonAdapterFactory;
1010
}

jsonb-jackson/src/test/java/org/example/MyComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
@Generated
88
@MetaData({CustomerJsonAdapter.class, ContactJsonAdapter.class})
9-
public class MyComponent implements Jsonb.Component {
9+
public class MyComponent implements Jsonb.GeneratedComponent {
1010

1111
@Override
1212
public void register(Jsonb.Builder builder) {

jsonb/src/main/java/io/avaje/jsonb/Jsonb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ interface AdapterBuilder {
425425
* Components register JsonAdapters Jsonb.Builder
426426
*/
427427
@FunctionalInterface
428-
interface Component extends JsonbComponent {
428+
interface GeneratedComponent extends JsonbComponent {
429429

430430
/**
431431
* Register JsonAdapters with the Builder.

jsonb/src/main/java/io/avaje/jsonb/core/DJsonb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private void registerComponents() {
271271
for (JsonbComponent next : ServiceLoader.load(JsonbComponent.class)) {
272272
next.register(this);
273273
}
274-
for (Component next : ServiceLoader.load(Component.class)) {
274+
for (GeneratedComponent next : ServiceLoader.load(GeneratedComponent.class)) {
275275
next.register(this);
276276
}
277277
}

jsonb/src/main/java9/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
uses io.avaje.jsonb.spi.AdapterFactory;
88
uses io.avaje.jsonb.spi.Bootstrap;
9-
uses io.avaje.jsonb.Jsonb.Component;
9+
uses io.avaje.jsonb.JsonbComponent;
10+
uses io.avaje.jsonb.Jsonb.GeneratedComponent;
1011

1112
}

0 commit comments

Comments
 (0)