All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mastfrog.webapi.Interpreter Maven / Gradle / Ivy

There is a newer version: 2.9.7
Show newest version
package com.mastfrog.webapi;

import com.google.inject.ImplementedBy;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpResponseStatus;

/**
 * Takes an HTTP response and translates it into some sort of object.
 * The default implementation handles JSON and string.
 *
 * @author Tim Boudreau
 */
@ImplementedBy(DefaultResponseInterceptor.class)
public abstract class Interpreter {

    public abstract  T interpret(HttpResponseStatus status,
            HttpHeaders headers, ByteBuf contents, Class as) throws Exception;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy