me.dhf.dict.chain.JqgridSelectProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dhf-dict Show documentation
Show all versions of dhf-dict Show documentation
Generate global dictionary JSON file and map for calling in the previous section or view
The newest version!
package me.dhf.dict.chain;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* jqgrid 处理
* @author 邓华锋 http://dhf.ink
*
*/
public class JqgridSelectProcessor implements SelectProcessor {
public static Map jqgridSelectMap = new LinkedHashMap();
private StringBuffer sb = new StringBuffer();
@Override
public void process(String value, String text) {
sb.append(value);
sb.append(":");
sb.append(text);
sb.append(";");
}
@Override
public void put(String key) {
String row=sb.toString();
row=row.substring(0, row.lastIndexOf(";"));
jqgridSelectMap.put(key, row);
sb = new StringBuffer();
}
@Override
public void putGlobalDict(Map globalDictVal) {
globalDictVal.put("jqgridSelect", jqgridSelectMap);
}
}