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

org.redkale.net.http.HttpRender Maven / Gradle / Ivy

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.redkale.net.http;

import org.redkale.convert.Convert;
import org.redkale.util.AnyValue;

/**
 * HTTP输出引擎的基类 
* HttpRender主要是给HttpResponse.finish(Object obj)提供指定数据类型的输出策略。
*
 * HttpResponse.finish(Object obj)内置对如下数据类型进行了特殊处理:
 *      CharSequence/String
 *      byte[]
 *      ByteBuffer
 *      ByteBuffer[]
 *      File
 *      HttpResult
 * 
*

* 如果对其他数据类型有特殊输出的需求,则需要自定义HttpRender。 *

* 详情见: https://redkale.org * * @author zhangjx * @param 泛型 */ public interface HttpRender { public void init(HttpContext context, AnyValue config); public void renderTo(HttpRequest request, HttpResponse response, Convert convert, V scope); public Class getType(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy