Person joe = new Person("Joe", "Walnes");joe.setPhone(new PhoneNumber(123, "1234-456"));joe.setFax(new PhoneNumber(123, "9999-999"));String xml = xstream.toXML(joe);<person> <firstname>Joe</firstname> <lastname>Walnes</lastname> <phone> <pre>123</pre> <number>1234-456</number> </phone> <fax> <pre>123</pre> <number>9999-999</number> </fax></person>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)