Package com.skaringa.javaxml

Examples of com.skaringa.javaxml.ObjectTransformer.deserialize()


      out.close();

      // Read a Person's XML file and create a new Person object
      // from its content.
      FileInputStream in = new FileInputStream("fred.xml");
      Person freddy = (Person) trans.deserialize(new StreamSource(in));
      in.close();

      // Check the result.
      if (fred.equals(freddy)) {
        System.out.println("OK");
View Full Code Here


      out.close();
      // ... and deserialize it again
      // Note that the transformer used for deserialization also needs
      // the property OMIT_XSI_TYPE
      in = new FileInputStream("fred_short.xml");
      Person freddyboy = (Person) trans.deserialize(new StreamSource(in));
      in.close();
      // Check the result.
      if (fred.equals(freddyboy)) {
        System.out.println("OK again");
      }
View Full Code Here

      // << endif Java 1.4

      // deserialize the node into a person
      if (ffNode != null) {
        Person p =
          (Person) trans.deserialize(
            new javax.xml.transform.dom.DOMSource(ffNode));
        System.out.println(p);
      }
    }
    catch (Exception e) {
View Full Code Here

        new StreamSource(ClassLoader.getSystemResourceAsStream(XSL_POST_RES)));

      // deserialize customized xml into a collection of strings
      // (using preprocessing instructions)
      Collection coll =
        (Collection) trans.deserialize(
          new StreamSource(ClassLoader.getSystemResourceAsStream(XML_IN_RES)));

      // work with the collection...
      Collection newColl = new ArrayList();
      Iterator it = coll.iterator();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.