标签:for 格式 element iter utf-8 xml序列化 his mars tag
xml和bean之间转化public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
@Override
public String toString() {
return "User{" +
"name=‘" + name + ‘\‘‘ +
", age=‘" + age + ‘\‘‘ +
‘}‘;
}
String xmlString = swriter.getBuffer().toString();
System.out.println(xmlString);
}catch (Exception e){
e.printStackTrace();
}
}
标签:for 格式 element iter utf-8 xml序列化 his mars tag
原文地址:https://blog.51cto.com/mufeng219/2417214