Nicholas.Jee
4 years ago
5 changed files with 40 additions and 12 deletions
After Width: | Height: | Size: 39 KiB |
@ -1,22 +1,38 @@
|
||||
package com.fr.plugin.tptj.tabledata.factory.demo; |
||||
|
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.tptj.plugin.hg.impl.AbstractLoader; |
||||
import com.tptj.plugin.hg.impl.AbstractResolver; |
||||
import com.tptj.plugin.hg.stable.SimpleDataModel; |
||||
|
||||
public class DemoResolver extends AbstractResolver { |
||||
/** |
||||
* |
||||
* @param data 来自装载器传来的数据 |
||||
* @param others 来自解析器面板,参数已经自动匹配了 |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public SimpleDataModel parse(Object o, String s) { |
||||
return null; |
||||
public SimpleDataModel parse(Object data, String others) { |
||||
SimpleDataModel dm = new SimpleDataModel(); |
||||
dm.addColumn("data"); //添加一个列名
|
||||
try { |
||||
dm.addRow(new String[]{(String) data}); //添加一列数据,这里把原始数据塞到了第一行
|
||||
return dm; |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
||||
} |
||||
|
||||
return new SimpleDataModel(); |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
return null; |
||||
return "DEMO_RESOLVER"; //有国际化需求的这里可以直接写i18n的key
|
||||
} |
||||
|
||||
@Override |
||||
public String getDefaultConfig() { |
||||
return null; |
||||
return "DefaultConfig"; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue