<html> <head> <title>(Un)marshalling</title> </head> <body text=#FFFFFF bgcolor=#000080 link=#000080 vlink=#800000 alink=#000080> <center> <a href="text0.htm">First page</a> <a href="text9.htm">Back</a> <a href="text11.htm">Continue</a> <a href="text41.htm">Last page</a> <a href="img10.htm">Graphic</a></center><br> <h1><b>(Un)marshalling</b></h1><p> <ul><li><h2><b><font color=#FF0000>// Create new CompanyInfo</b></font></h2> <li><h2><b>Project info = new Project(“"Castor"”); </b></h2> <li><h2><b><font color=#FF0000>// Marshal as XML</b></font></h2> <li><h2><b>File xmlFile = new File(“"test.xml"”); Marshaller.marshal( info, new FileWriter( xmlFile ) );</b></h2> <li><h2><b></b></h2> <li><h2><b><font color=#FF0000>// Unmarshal from XML</font> info = (Project) Unmarshaller.unmarshal( Project.class, new FileReader( xmlFile ) );</b></h2> </ul></body> </html>