org.jboss.resteasy.reactive.server.providers.serialisers.ServerNumberMessageBodyHandler Maven / Gradle / Ivy
package org.jboss.resteasy.reactive.server.providers.serialisers;
import java.io.IOException;
import java.lang.reflect.Type;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.MediaType;
import org.jboss.resteasy.reactive.common.providers.serialisers.NumberMessageBodyHandler;
import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo;
import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader;
import org.jboss.resteasy.reactive.server.spi.ServerRequestContext;
public class ServerNumberMessageBodyHandler extends NumberMessageBodyHandler
implements ServerMessageBodyReader {
@Override
public boolean isReadable(Class> type, Type genericType, ResteasyReactiveResourceInfo lazyMethod, MediaType mediaType) {
return Number.class.isAssignableFrom(type);
}
@Override
public Number readFrom(Class type, Type genericType, MediaType mediaType, ServerRequestContext context)
throws WebApplicationException, IOException {
return doReadFrom(type, context.getInputStream());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy