Package com.fengjing.framework.xstream.annotation

Examples of com.fengjing.framework.xstream.annotation.Person


   
    xstream.processAnnotations(Person.class);
   
    String xml="<person><firstname>Joe</firstname><lastname>Walnes</lastname><phone><code>123</code><number>1234-456</number></phone><fax><code>123</code><number>9999-999</number></fax></person>";
   
    Person person = (Person)xstream.fromXML(xml);
   
    System.out.println(person);
  }
View Full Code Here


    //XStream xstream = new XStream(new DomDriver()); // does not require XPP3 library
    //XStream xstream = new XStream(new StaxDriver()); // does not require XPP3 library starting with Java 6
   
    xstream.processAnnotations(Person.class);
   
    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);
   
    System.out.println(xml);
  }
View Full Code Here

TOP

Related Classes of com.fengjing.framework.xstream.annotation.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.