Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.MappingObjectModelProvider$ClassToElementMapping


   {
      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.declareNamespace("imm", "http://www.jboss.org/test/xml/immutable/");
      marshaller.marshal(xsd,
         new MappingObjectModelProvider(),
         parent,
         writer
      );

      log.info("parent:\n" + parent);
View Full Code Here


      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.declareNamespace("chs", "http://www.jboss.org/test/xml/choice/");
      //marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      marshaller.marshal(xsdUrl,
         new MappingObjectModelProvider(),
         root,
         writer
      );

      log.info("marshalled root:\n" + writer.getBuffer());
View Full Code Here

   {
      StringWriter writer = new StringWriter();
      XercesXsMarshaller marshaller = new XercesXsMarshaller();
      initMarshaller(marshaller);
      marshaller.setSchemaResolver(SCHEMA_RESOLVER);
      marshaller.marshal(new StringReader(XSD), new MappingObjectModelProvider(), Collections.singleton(book), writer);
      return writer.getBuffer().toString();
   }
View Full Code Here

   {
      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      initMarshaller(marshaller);
      marshaller.setSchemaResolver(SCHEMA_RESOLVER);
      marshaller.marshal(new StringReader(XSD), new MappingObjectModelProvider(), Collections.singleton(book), writer);
      return writer.getBuffer().toString();
   }
View Full Code Here

   public void testMarshallingXerces() throws Exception
   {
      XercesXsMarshaller marshaller = new XercesXsMarshaller(); //new MarshallerImpl();
      marshaller.setSchemaResolver(SCHEMA_RESOLVER);
      StringWriter writer = new StringWriter();
      marshaller.marshal(new StringReader(XSD), new MappingObjectModelProvider(), E.INSTANCE, writer);
      assertXmlEqual(XML, writer.getBuffer().toString());
   }
View Full Code Here

   public void testSimpleMarshallingXerces() throws Exception
   {
      XercesXsMarshaller marshaller = new XercesXsMarshaller();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      StringWriter writer = new StringWriter();
      marshaller.marshal(new StringReader(XSD), new MappingObjectModelProvider(), GLOBAL_SIMPLE, writer);
      String marshalled = writer.getBuffer().toString();
      assertXmlEqual(XML_SIMPLE, marshalled);
   }
View Full Code Here

         "</xsd:schema>";

      java.util.Date date = java.util.Calendar.getInstance().getTime();

      marshaller.declareNamespace(null, "http://www.jboss.org/test/xml/datetime");
      MappingObjectModelProvider provider = new MappingObjectModelProvider();
      StringWriter writer = new StringWriter();
      marshaller.marshal(new StringReader(xsd), provider, date, writer);

      String marshalled = writer.getBuffer().toString();
View Full Code Here

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      Object result = unmarshaller.unmarshal(new StringReader(xml), schema);

      marshaller.declareNamespace(null, "http://www.jboss.org/test/xml/datetime");
      MappingObjectModelProvider provider = new MappingObjectModelProvider();
      StringWriter writer = new StringWriter();
      marshaller.marshal(new StringReader(xsd), provider, result, writer);

      assertXmlEqual(xml, writer.getBuffer().toString());
   }
View Full Code Here

      StringWriter writer = new StringWriter();
      marshaller.declareNamespace("imm", "http://www.jboss.org/test/xml/immutable/");
      //marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      marshaller.marshal(xsdUrl.toExternalForm(),
         new MappingObjectModelProvider(),
         parent,
         writer
      );
      String xml = writer.getBuffer().toString();
View Full Code Here

      XercesXsMarshaller marshaller = new XercesXsMarshaller();
      marshaller.setSchemaResolver(SCHEMA_RESOLVER);
      marshaller.mapClassToXsiType(UKAddress.class, PO_NS, "UKAddress");
      marshaller.mapClassToXsiType(USAddress.class, PO_NS, "USAddress");

      MappingObjectModelProvider provider = new MappingObjectModelProvider();

      StringWriter writer = new StringWriter();
      marshaller.marshal(new StringReader(PO_XSD), provider, PurchaseOrder.INSTANCE, writer);
      assertXmlEqual(PO_XML, writer.getBuffer().toString());
   }
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.MappingObjectModelProvider$ClassToElementMapping

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.