package cc.smtweb.framework.core.mvc.controller.binder.attr;

import cc.smtweb.framework.core.mvc.controller.IBeanContext;
import cc.smtweb.framework.core.mvc.controller.IEditor;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * API函数@SwBody参数的转换处理，POST请求直接转换Json内容为Bean对象，GET请求转换Map请求参数为Bean对
 *
 * @author xkliu
 */
public abstract class AbstractAttrEditor implements IEditor {
    @Override
    public Object getParamValue(String paramName, Class<?> paramType, IBeanContext context, Map<String, Object> params, String body, HttpServletRequest request) {
        return getValue(paramName, paramType, request);
    }

    public abstract Object getValue(String paramName, Class<?> paramType, HttpServletRequest request);
}
