有xml:
<root>
<person id = "123"/>
</root>
豆映射:
public class Root {
private Person person;
public void setPerson(Person person) ...
}
public class Person {
String id;
public void setId(String id) ...
}
我不知道,如何以这种风格使用它的setter ( )来实现类设置digester3
的模式:id
Person
setId(String id)
new AbstractRulesModule() {
@Override
protected void configure() {
forPattern("root").createObject().ofType(Root.class);
forPattern("root/person").createObject().ofType(Person.class).then().setNext("setPerson");
}
}