org.webframe.web.springmvc.bean.AjaxError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wf-web-springmvc Show documentation
Show all versions of wf-web-springmvc Show documentation
Java Web Frame: wf-web-springmvc
/*
* com.berheley.bi.basic
* Created on 2011-12-4-上午10:23:58
*/
package org.webframe.web.springmvc.bean;
import net.sf.json.JSONObject;
/**
* Ajax 错误信息
*
* @author 黄国庆
* @since 2012-1-30 上午08:30:16
* @version
*/
public class AjaxError extends AjaxJson {
private JSONObject error = null;
public AjaxError() {
}
public AjaxError(JSONObject error) {
this.error = error;
}
public AjaxError putError(String key, String error) {
createError();
this.error.put(key, error);
return this;
}
protected JSONObject createError() {
if (this.error == null) this.error = new JSONObject();
return this.error;
}
@Override
public String toString() {
createError();
putMsg("error", error);
return super.toString();
}
}