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; |
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.AbstractLoader; |
||||||
import com.tptj.plugin.hg.impl.AbstractResolver; |
import com.tptj.plugin.hg.impl.AbstractResolver; |
||||||
import com.tptj.plugin.hg.stable.SimpleDataModel; |
import com.tptj.plugin.hg.stable.SimpleDataModel; |
||||||
|
|
||||||
public class DemoResolver extends AbstractResolver { |
public class DemoResolver extends AbstractResolver { |
||||||
|
/** |
||||||
|
* |
||||||
|
* @param data 来自装载器传来的数据 |
||||||
|
* @param others 来自解析器面板,参数已经自动匹配了 |
||||||
|
* @return |
||||||
|
*/ |
||||||
@Override |
@Override |
||||||
public SimpleDataModel parse(Object o, String s) { |
public SimpleDataModel parse(Object data, String others) { |
||||||
return null; |
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 |
@Override |
||||||
public String getName() { |
public String getName() { |
||||||
return null; |
return "DEMO_RESOLVER"; //有国际化需求的这里可以直接写i18n的key
|
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public String getDefaultConfig() { |
public String getDefaultConfig() { |
||||||
return null; |
return "DefaultConfig"; |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue