<?xml version="1.0" encoding="GB2312"?>
abcd
23
cctv
1
这是一个XML 请问用Xstream解析的时候应该怎样构建类
目前我的类是
//Groupinfo
public class Groupinfo {
private List persons=new ArrayList();
public List getPersons() {
return persons;
}
public void setPersons(List persons) {
this.persons = persons;
}
private void addPeron(Person person){
persons.add(person);
}
}
//Person
public class Person {
private String name;
private String age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
}
解析的时候回报错,请问该那么设计类