Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ static Jex.Server start(Jex jex, SpiRoutes routes) {
jex.lifecycle().status(AppLifecycle.Status.STARTED);
log.log(
INFO,
"Avaje Jex started {0} on port {1}://{2}:{3,number,#}",
"Avaje Jex {0} started {1} on {2}://{3}:{4,number,#}",
BootstrapServer.class.getPackage().getImplementationVersion(),
serverClass,
scheme,
actualAddress.getHostName(),
Expand Down
5 changes: 0 additions & 5 deletions avaje-jex/src/main/java/io/avaje/jex/core/JdkContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ public byte[] bodyAsBytes() {
}
}

@Override
public <T> T bodyAsClass(Class<T> beanType) {
return mgr.fromJson(beanType, bodyAsInputStream());
}

@Override
public InputStream bodyAsInputStream() {
return exchange.getRequestBody();
Expand Down
4 changes: 0 additions & 4 deletions avaje-jex/src/main/java/io/avaje/jex/core/ServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ JsonService jsonService() {
return jsonService;
}

<T> T fromJson(Class<T> type, InputStream is) {
return jsonService.fromJson(type, is);
}

<T> T fromJson(Type type, InputStream is) {
return jsonService.fromJson(type, is);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ public JacksonJsonService(ObjectMapper mapper) {
this.mapper = mapper;
}

@Override
public <T> T fromJson(Class<T> type, InputStream is) {
try {
return mapper.readValue(is, type);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}

@Override
public <T> T fromJson(Type type, InputStream is) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public JsonbJsonService(Jsonb jsonb) {
this.jsonb = jsonb;
}

@Override
public <T> T fromJson(Class<T> clazz, InputStream is) {
return jsonb.type(clazz).fromJson(is);
}

@Override
public <T> T fromJson(Type clazz, InputStream is) {
return jsonb.<T>type(clazz).fromJson(is);
Expand Down
4 changes: 3 additions & 1 deletion avaje-jex/src/main/java/io/avaje/jex/http/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public interface Context {
*
* @param beanType The bean type
*/
<T> T bodyAsClass(Class<T> beanType);
default <T> T bodyAsClass(Class<T> beanType) {
return bodyAsType(beanType);
}

/**
* Returns the request body as an input stream.
Expand Down
12 changes: 0 additions & 12 deletions avaje-jex/src/main/java/io/avaje/jex/spi/JsonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ public non-sealed interface JsonService extends JexExtension {
*/
String toJsonString(Object bean);

/**
* **Reads JSON from an InputStream**
*
* <p>Reads a JSON-formatted input stream and deserializes it into a Java object of the specified
* type.
*
* @param type the Class object of the desired type
* @param is the input stream containing the JSON data
* @return the deserialized object
*/
<T> T fromJson(Class<T> type, InputStream is);

/**
* **Reads JSON from an InputStream**
*
Expand Down