package com.sf.apijson.config;

import com.alibaba.fastjson.JSONObject;

import apijson.RequestMethod;
import apijson.framework.APIJSONObjectParser;
import apijson.framework.APIJSONParser;
import apijson.orm.SQLConfig;

public class FormParser extends APIJSONParser<String> {
	public FormParser() {
		super();
	}

	public FormParser(RequestMethod method) {
		super(method);
	}

	public FormParser(RequestMethod method, boolean needVerify) {
		super(method, needVerify);
	}

	// 可重写来设置最大查询数量
	@Override
	public int getMaxQueryCount() {
		return 100;
	}

	@Override
	public APIJSONObjectParser createObjectParser(JSONObject request, String parentPath, SQLConfig arrayConfig,
			boolean isSubquery, boolean isTable, boolean isArrayMainTable) throws Exception {
		return new FormObjectParser(getSession(), request, parentPath, arrayConfig, isSubquery, isTable,
				isArrayMainTable).setMethod(getMethod()).setParser(this);
	}

}