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

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


   public void testMarshallingSundayDom() throws Exception
   {
      MarshallerImpl marshaller = new MarshallerImpl();
      setupDomMarshaller(marshaller);
      StringWriter writer = new StringWriter();
      marshaller.marshal(new StringReader(XSD), null, ArrayOfAny.DOM_INSTANCE, writer);
      String marshalled = writer.getBuffer().toString();
      assertXmlEqual(XML, marshalled);
   }

   // Private
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

   {
      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

   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());
   }

   // Inner
View Full Code Here

   {
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.setProperty(Marshaller.PROP_OUTPUT_INDENTATION, "false");
      StringWriter writer = new StringWriter();
      marshaller.marshal(schema, null, GLOBAL_SIMPLE, writer);
      String marshalled = writer.getBuffer().toString();
      assertXmlEqual(XML_SIMPLE, marshalled);
   }

   public void testSimpleMarshallingXerces() throws Exception
View Full Code Here

      assertEquals(firstName, person.getFirstName());
      assertEquals(lastName, person.getLastName());

      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.marshal(schema, null, person, writer);
      String marshalled = writer.getBuffer().toString();
      assertXmlEqual(xml, marshalled);
   }

   public void testImmutableXerces() throws Exception
View Full Code Here

      SchemaBinding schema = getSchema();
      MarshallerImpl marshaller = getMarshaller();
      StringWriter writer = new StringWriter();
      GlobalElement global = new GlobalElement();
      global.stringType = GlobalElement.STRING_TYPE;
      marshaller.marshal(schema, null, global, writer);
      assertXmlEqual(XML_STRING_TYPE, writer.getBuffer().toString());
   }

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

      SchemaBinding schema = getSchema();
      MarshallerImpl marshaller = getMarshaller();
      StringWriter writer = new StringWriter();
      GlobalElement global = new GlobalElement();
      global.stringElement = GlobalElement.TEXT;
      marshaller.marshal(schema, null, global, writer);
      assertXmlEqual(XML_STRING_ELEMENT, writer.getBuffer().toString());
   }

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

      SchemaBinding schema = getSchema();
      MarshallerImpl marshaller = getMarshaller();
      StringWriter writer = new StringWriter();
      GlobalElement global = new GlobalElement();
      global.sequenceItem = GlobalElement.STRING_TYPE;
      marshaller.marshal(schema, null, global, writer);
      assertXmlEqual(XML_SEQUENCE_ITEM, writer.getBuffer().toString());
   }

   public void testTermAfterUnmarshallingHandler_sequenceItem() 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.