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

com.jianggujin.http.core.JRequestBodyResolver Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2018 jianggujin (www.jianggujin.com).
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jianggujin.http.core;

import java.io.IOException;

import com.jianggujin.http.util.JOutputStream;

/**
 * 请求体解析器
 * 
 * @author jianggujin
 *
 */
public interface JRequestBodyResolver {

    /**
     * 将数据写入到输出流
     * 
     * @param req    请求对象
     * @param object 请求参数
     * @param stream 输出流
     * @throws IOException
     */
    void write(JRequest req, Object object, JOutputStream stream) throws IOException;

    /**
     * 是否支持,如果是直接调用{@link JRequest#requestBodyResolver(JRequestBodyResolver)}设置的解析器不会执行本方法进行判断
     * 
     * @param clazz
     * @return
     */
    boolean support(Class clazz);

    /**
     * 排序,值越小,越先使用
     * 
     * @return
     */
    int order();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy