You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.2 KiB
89 lines
2.2 KiB
/* |
|
* Copyright (C), 2015-2019 |
|
* FileName: ParamConfig |
|
* Author: xx |
|
* Date: 2019/09/09 |
|
* Description: ParamConfig |
|
* History: |
|
* <author> <time> <version> <desc> |
|
* 作者姓名 修改时间 版本号 描述 |
|
*/ |
|
package com.fr.plugin.isgd.menu; |
|
|
|
import com.fanruan.api.err.JSONException; |
|
import com.fanruan.api.json.JSONKit; |
|
import com.fr.json.JSONObject; |
|
import com.fr.stable.fun.impl.AbstractIOFileAttrMark; |
|
import com.fr.stable.xml.XMLPrintWriter; |
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
/** |
|
* <功能简述><br> |
|
* <ParamConfig> |
|
* |
|
* @author xx |
|
* @create 2019/09/09 |
|
* @since 1.0.0 |
|
*/ |
|
public class ParamConfig extends AbstractIOFileAttrMark { |
|
public static final String XML_TAG = "CustomColumnConfig"; |
|
|
|
private String headerRow; |
|
|
|
public ParamConfig() { |
|
|
|
} |
|
|
|
@Override |
|
public void readXML(XMLableReader xmLableReader) { |
|
if (xmLableReader.isChildNode()) { |
|
String tagName = xmLableReader.getTagName(); |
|
if ("Attr".equals(tagName)) { |
|
setHeaderRow(xmLableReader.getAttrAsString("headerRow", "1")); |
|
} |
|
} |
|
} |
|
|
|
@Override |
|
public void writeXML(XMLPrintWriter xmlPrintWriter) { |
|
xmlPrintWriter.startTAG("Attr"); |
|
xmlPrintWriter.attr("headerRow", headerRow); |
|
xmlPrintWriter.end(); |
|
} |
|
|
|
@Override |
|
public ParamConfig clone() { |
|
ParamConfig cloned = (ParamConfig) super.clone(); |
|
cloned.headerRow = headerRow; |
|
return cloned; |
|
} |
|
|
|
@Override |
|
public JSONObject createJSONConfig() throws JSONException { |
|
JSONObject paramJSON = JSONKit.create(); |
|
paramJSON.put("headerRow", headerRow); |
|
return paramJSON; |
|
} |
|
|
|
@Override |
|
public String xmlTag() { |
|
return XML_TAG; |
|
} |
|
|
|
public String getHeaderRow() { |
|
return headerRow; |
|
} |
|
|
|
public void setHeaderRow(String headerRow) { |
|
this.headerRow = headerRow; |
|
} |
|
|
|
public int[] getHeaderRowInts() { |
|
String[] headerArray = this.headerRow.split(","); |
|
int[] headers = new int[headerArray.length]; |
|
for (int i = 0; i < headerArray.length; i++) { |
|
headers[i] = Integer.parseInt(headerArray[i]); |
|
} |
|
return headers; |
|
} |
|
}
|
|
|