首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

Betwixt应用笔记——指定.betwixt模板文件

2012-11-19 
Betwixt使用笔记——指定.betwixt模板文件在使用betwixt根据Bean生成xml文件时,Betwixt默认识别的xml模版文

Betwixt使用笔记——指定.betwixt模板文件
在使用betwixt根据Bean生成xml文件时,Betwixt默认识别的xml模版文件是以bean的名称为主文件名的".betwixt"文件。
比如:
person.class
person.betwixt

如果我希望能够重新指定其他文件作为模版文件的话,该如何操作呢?
比如我希望使用hello.betwixt作为person.class的模板文件,
BeanWriter提供了如下方法:
    public void write(Object bean, InputSource source)

    InputSource ins = new InputSource(new FileReader("D:\\workspace\\translate_demo\\cfg\\hello.betwixt"));       beanWriter.write(person,ins);  


这样就成了~:)

热点排行