Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.Unmarshaller.unmarshal()


      Unmarshaller unmarshaller = factory.newUnmarshaller();
      KernelDeployment deployment = null;
      try
      {
         deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver);
      }
      catch (Exception e)
      {
         throw new RuntimeException("Failed to parse xml " + url, e);
      }
View Full Code Here


         entityResolver = new NullEntityResolver();
      }
      try
      {
         unmarshaller.setEntityResolver(entityResolver);
         initConsumers((SortedMap<String, WSRPConsumer>)unmarshaller.unmarshal(configurationIS, factory, null));
      }
      catch (JBossXBException e)
      {
         throw new RuntimeException("Couldn't unmarshall WSRP Consumers configuration", e);
      }
View Full Code Here

   public void testUnmarshalling() throws Exception
   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(PO_XSD), null, SCHEMA_RESOLVER);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(PO_XML), schema);
      assertEquals(PurchaseOrder.INSTANCE, o);
   }

   public void testMarshallingXerces() throws Exception
   {
View Full Code Here

   public void testUnmarshalCollection() throws Exception
   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(COLLECTION_XSD), null, SCHEMA_RESOLVER);
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(COLLECTION_XML), schema);
     
      assertNotNull(o);
      assertTrue(o instanceof PurchaseOrder);
     
      PurchaseOrder po = (PurchaseOrder) o;
View Full Code Here

      // TODO: the xml diff trims whitespaces...
      //assertXmlFileContent("IgnorableWhitespaceContent.xml", writer.getBuffer().toString());
      //System.out.println(writer.getBuffer().toString());
     
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(writer.getBuffer().toString()), schema);
     
      assertEquals(top, o);
   }

   public void testObjectModelFactory() throws Exception
View Full Code Here

      String url = findXML("IgnorableWhitespaceContent.xml");
     
      ObjectModelFactory omf = new OMF();
     
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(url, omf, null);
     
      assertNotNull(o);
      assertTrue(o instanceof Top);
      Top top = (Top) o;
      assertEquals(2, top.string.size());
View Full Code Here

      long start = System.currentTimeMillis();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
      log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms");
      try
      {
         Object result = unmarshaller.unmarshal(url, resolver);
         log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms");
         return result;
      }
      catch (Exception e)
      {
View Full Code Here

      long start = System.currentTimeMillis();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
      log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms");
      try
      {
         Object result = unmarshaller.unmarshal(url, schema);
         log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms");
         return result;
      }
      catch (Exception e)
      {
View Full Code Here

   {
      SchemaBinding schema = getSchemaBinding(true);
     
      // unmarshal
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(XML), schema);

      assertArrayOfAnyGenericElement(o);
   }

   public void testUnmarshallingDom() throws Exception
View Full Code Here

   {
      SchemaBinding schema = getSchemaBinding(false);

      // unmarshal
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object o = unmarshaller.unmarshal(new StringReader(XML), schema);

      assertArrayOfAnyDom(o);
   }

   public void testMarshallingXercesGenericElement() throws Exception
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.