Package org.jboss.xb.binding.sunday.marshalling

Examples of org.jboss.xb.binding.sunday.marshalling.MarshallerImpl.marshal()


      PurchaseOrder po = new PurchaseOrder();
      po.address = new Address[2];
      po.address[0] = PurchaseOrder.INSTANCE.billTo;
      po.address[1] = PurchaseOrder.INSTANCE.shipTo;
     
      marshaller.marshal(schema, null, po, writer);
      assertXmlEqual(COLLECTION_XML, writer.getBuffer().toString());
   }

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


      marshaller.setSchemaResolver(SCHEMA_RESOLVER);
      marshaller.mapClassToXsiType(UKAddress.class, PO_NS, "UKAddress");

      StringWriter writer = new StringWriter();

      marshaller.marshal(schema, null, PurchaseOrder.INSTANCE.shipTo, writer);
      assertXmlEqual(ONE_ADDRESS_XML, writer.getBuffer().toString());
   }

   // Inner
View Full Code Here

      MyType root = new MyType();
      root.anything = dom;
     
      MarshallerImpl marshaller = new MarshallerImpl();
      StringWriter writer = new StringWriter();
      marshaller.marshal(schema, null, root, writer);
     
      assertXmlFileContent(rootName + "_complexContent.xml", writer.getBuffer().toString());
   }

   public void testSimpleContentMarshalling() throws Exception
View Full Code Here

      MyType root = new MyType();
      root.anything = "test";
     
      MarshallerImpl marshaller = new MarshallerImpl();
      StringWriter writer = new StringWriter();
      marshaller.marshal(schema, null, root, writer);
     
      assertXmlFileContent(rootName + "_simpleContent.xml", writer.getBuffer().toString());
   }

   private SchemaBinding bindSchema() throws Exception
View Full Code Here

   public void testMarshallingNoValueSunday() throws Exception
   {
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      StringWriter writer = new StringWriter();
      marshaller.marshal(SCHEMA, null, new E(), writer);
      String xml = writer.getBuffer().toString();
      assertXmlEqual(XML_NO_VALUE, xml);
   }

   public void testMarshallingWithValueSunday() throws Exception
View Full Code Here

   public void testMarshallingWithValueSunday() throws Exception
   {
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      StringWriter writer = new StringWriter();
      marshaller.marshal(SCHEMA, null, new E("val"), writer);
      String xml = writer.getBuffer().toString();
      assertXmlEqual(XML_WITH_VALUE, xml);
   }

   public void testMBeanUnmarshalling() throws Exception
View Full Code Here

   public void testMarshallingSunday() throws Exception
   {
      MarshallerImpl marshaller = new MarshallerImpl();
      StringWriter writer = new StringWriter();
      marshaller.marshal(SCHEMA, null, E.INSTANCE, writer);
      assertXmlEqual(XML, writer.getBuffer().toString());
   }

   /**
    * Attribute binding can't be created with a complex type not being
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();
   }

   private void initMarshaller(AbstractMarshaller marshaller)
   {
View Full Code Here

      throws IOException, SAXException
   {
      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
      );
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
      );
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.