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

Examples of org.jboss.xb.binding.sunday.marshalling.MarshallerImpl$MarshallingContextImpl


      dom.setTextContent("test");

      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());
   }
View Full Code Here


      assertXmlEqual(XML_WITH_VALUE, xml);
   }

   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);
   }
View Full Code Here

      assertXmlEqual(XML_NO_VALUE, xml);
   }

   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);
   }
View Full Code Here

      assertXmlEqual(XML, writer.getBuffer().toString());
   }

   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());
   }
View Full Code Here

/*  60 */   private HashMap properties = new HashMap();
/*     */   private MarshallerImpl delegate;
/*     */
/*     */   public JBossXBMarshallerImpl()
/*     */   {
/*  69 */     this.delegate = new MarshallerImpl();
/*  70 */     this.delegate.setProperty("org.jboss.xml.binding.marshalling.version", "false");
/*  71 */     this.delegate.setProperty("org.jboss.xml.binding.marshalling.indent", "false");
/*  72 */     this.delegate.declareNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
/*  73 */     this.delegate.setSupportNil(true);
/*     */   }
View Full Code Here

   private String marshalSunday(Book book)
      throws Exception
   {
      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

   private String marshalImmutableParent(String xsd, Parent parent)
      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

   private static String marshalChoiceRoot(String xsdUrl, Root root)
      throws IOException, SAXException
   {
      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

   public void testMarshallingInvalidObject() throws Exception
   {     
      E root = new E();
      StringWriter writer = new StringWriter();
     
      MarshallerImpl marshaller = new MarshallerImpl();
     
      try
      {
         marshaller.marshal(SCHEMA, null, root, writer);
         fail("required attribute is missing");
      }
      catch(JBossXBRuntimeException e)
      {
         // expected
View Full Code Here

   public void testMarshallingValidObject() throws Exception
   {     
      E root = new E();
      root.unqualified = "1";
      StringWriter writer = new StringWriter();
      MarshallerImpl marshaller = new MarshallerImpl();
      marshaller.marshal(SCHEMA, null, root, writer);
     
      String xml = "<root xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='testns' unqualified='1'/>";
      assertXmlEqual(xml, writer.getBuffer().toString());
   }
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.sunday.marshalling.MarshallerImpl$MarshallingContextImpl

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.