/* ==================================================================
* Created [2009-4-27 下午11:32:55] by Jon.King
* ==================================================================
* TSS
* ==================================================================
* mailTo:jinpujun@hotmail.com
* Copyright (c) Jon.King, 2009-2012
* ==================================================================
*/
package com.jinhe.tss.core.web.dispaly.grid;
import java.util.Iterator;
import java.util.List;
/**
* <p> SimpleGridParser.java </p>
*
* 简易Grid解析器
*/
public class SimpleGridParser extends GridParser {
/**
* 解析Grid数据
*
* @param data
* @return
* @throws Exception
*/
public GridNode parse(Object data, int dataType) {
if (data == null) {
return null;
}
GridNode root = new GridNode();
Iterator<?> iter = ((List<?>) data).iterator();
while (iter.hasNext()) {
root.addChild(new GridNode(iter.next(), this.getColumns(), dataType));
}
return root;
}
}