中文版:https://github.com/bluejoe2008/spring-beans-writer/blob/master/README_CN.md
writer for spring IOC beans files
it is too easy to use, please see the test case:
https://github.com/bluejoe2008/spring-beans-writer/blob/master/test/cn/bluejoe/SpringBeansTest.java
import spring-beans-writer:
<!-- https://mvnrepository.com/artifact/com.github.bluejoe2008/spring-beans-writer -->
<dependency>
<groupId>com.github.bluejoe2008</groupId>
<artifactId>spring-beans-writer</artifactId>
<version>0.9</version>
</dependency>
example codes:
SpringBeans beans = new SpringBeans();
beans.addBean(_database, "database");
beans.addBeans(_persons);
SpringBeansWriter sbw = new SpringBeansWriter();
List<FilteredOutput> outputs = new ArrayList<FilteredOutput>();
outputs.add(new SimpleFilteredOutput(new File("spring_beans.xml")));
sbw.write(beans, outputs);
you can require spring-beans-writer save beans into multiple files:
List<FilteredOutput> outputs = new ArrayList<FilteredOutput>();
//write tables into a spring_persons.xml
outputs.add(new SimpleFilteredOutput(new Matcher<EntityNode<?>>()
{
@Override
public boolean matches(EntityNode<?> x)
{
return x.getValue().getClass() == Person.class;
}
}, new File("spring_persons.xml")));
outputs.add(new SimpleFilteredOutput(new File("spring_databases.xml")));
sbw.write(beans, outputs);
on default, only annotated properties of a JavaBean will be written into output files. To annotate a JavaBean property, use '@XmlProperty':
@XmlProperty
public void setName(String name)
{
_name = name;
}
you can let spring-beans-writer write all JavaBean properties:
SpringBeansWriter sbw = new SpringBeansWriter(new DumpAllProperties());
special thanks to suxianming@gmail.com, the guy who have ever worked on the project with me.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型