Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.MappingObjectModelFactory$ElementToClassMapping


   {
      log.debug("Reading resource: '" + this.managersResName + "'");
     
      // configure ObjectModelFactory for mapping XML to POJOs
      // we'll be simply getting an ArrayList of Manager objects
      MappingObjectModelFactory momf = new MappingObjectModelFactory();
      momf.mapElementToClass("manager-list", ArrayList.class);
      momf.mapElementToClass("manager", Manager.class);

      ArrayList managerList = null;
      InputStream is = null;
      try
      {
View Full Code Here


   {
      log.debug("Reading resource: '" + this.managersResName + "'");
     
      // configure ObjectModelFactory for mapping XML to POJOs
      // we'll be simply getting an ArrayList of Manager objects
      MappingObjectModelFactory momf = new MappingObjectModelFactory();
      momf.mapElementToClass("manager-list", ArrayList.class);
      momf.mapElementToClass("manager", Manager.class);

      ArrayList managerList = null;
      InputStream is = null;
      try
      {
View Full Code Here

      Root root = newChoiceRoot();
      String xml = marshalChoiceRoot(xsdUrl, root);

      StringReader reader = new StringReader(xml);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Root unmarshalled = (Root)unmarshaller.unmarshal(reader, new MappingObjectModelFactory(), null);
      log.info("unmarhalled:\n" + unmarshalled);

      assertEquals(root, unmarshalled);

      log.debug("testChoice> done in " + (System.currentTimeMillis() - startTime));
View Full Code Here

      Parent parent = newImmutableParent();
      String xml = marshalImmutableParent(xsd, parent);

      StringReader reader = new StringReader(xml);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Parent unmarshalled = (Parent)unmarshaller.unmarshal(reader, new MappingObjectModelFactory(), null);
      log.info("unmarhalled:\n" + unmarshalled);

      assertEquals(parent, unmarshalled);

      log.debug("testImmutable> done in " + (System.currentTimeMillis() - startTime));
View Full Code Here

   }

   private Person unmarshalPerson(Reader xmlReader)
      throws Exception
   {
      MappingObjectModelFactory factory = new MappingObjectModelFactory();
      factory.mapElementToClass("person", Person.class);
      factory.mapElementToField("date-of-birth", Person.class, "dateOfBirth", SimpleTypeBindings.JAVA_UTIL_DATE);
      factory.mapElementToClass("phones", ArrayList.class);
      factory.mapElementToClass("addresses", ArrayList.class);
      factory.mapElementToClass("address", Address.class);

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      unmarshaller.setEntityResolver(
         new EntityResolver()
         {
View Full Code Here

      Root root = newChoiceRoot();
      String xml = marshalChoiceRoot(xsdUrl, root);

      StringReader reader = new StringReader(xml);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Root unmarshalled = (Root)unmarshaller.unmarshal(reader, new MappingObjectModelFactory(), null);
      assertEquals(root, unmarshalled);

      log.debug("testChoice> done in " + (System.currentTimeMillis() - startTime));
   }
View Full Code Here

      Parent parent = newImmutableParent();
      String xml = marshalImmutableParent(xsd, parent);

      StringReader reader = new StringReader(xml);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Parent unmarshalled = (Parent)unmarshaller.unmarshal(reader, new MappingObjectModelFactory(), null);
      assertEquals(parent, unmarshalled);

      log.debug("testImmutable> done in " + (System.currentTimeMillis() - startTime));
   }
View Full Code Here

   }

   private Person unmarshalPerson(Reader xmlReader)
      throws Exception
   {
      MappingObjectModelFactory factory = new MappingObjectModelFactory();
      factory.mapElementToClass("person", Person.class);
      factory.mapElementToField("date-of-birth", Person.class, "dateOfBirth", SimpleTypeBindings.JAVA_UTIL_DATE);
      factory.mapElementToClass("phones", ArrayList.class);
      factory.mapElementToClass("addresses", ArrayList.class);
      factory.mapElementToClass("address", Address.class);

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      unmarshaller.setEntityResolver(
         new EntityResolver()
         {
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.MappingObjectModelFactory$ElementToClassMapping

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.