Examples of marshal()


Examples of org.jboss.seam.remoting.wrapper.DateWrapper.marshal()

      cal.set(Calendar.MILLISECOND, 150);

      assertEquals(cal.getTime(), wrapper.convert(Date.class));

      ByteArrayOutputStream out = new ByteArrayOutputStream();
      wrapper.marshal(out);

      byte[] expected = ("<date>" + value + "</date>").getBytes();
      assertEquals(expected, out.toByteArray());

      try
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.MapWrapper.marshal()

      {
      }

      // ensure when we marshal/unmarshal the values in the map remain the same     
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      wrapper.marshal(out);
     
      SAXReader xmlReader = new SAXReader();
      Document doc = xmlReader.read( new ByteArrayInputStream(out.toByteArray()) );    
     
      Element root = doc.getRootElement();     
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.NullWrapper.marshal()

      NullWrapper wrapper = new NullWrapper();
      assert wrapper.convert(null) == null;

      byte[] expected = "<null/>".getBytes();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      wrapper.marshal(out);
      assertEquals(expected, out.toByteArray());

      assert ConversionScore.compatible == wrapper.conversionScore(null);
      assert ConversionScore.compatible == wrapper
            .conversionScore(Object.class);
View Full Code Here

Examples of org.jboss.seam.remoting.wrapper.StringWrapper.marshal()

                  .toString());
      assert value.equals(((StringBuffer) wrapper.convert(StringBuffer.class))
            .toString());

      ByteArrayOutputStream out = new ByteArrayOutputStream();
      wrapper.marshal(out);
      byte[] expected = ("<str>"
            + URLEncoder.encode(value, StringWrapper.DEFAULT_ENCODING) + "</str>")
            .replace("+", "%20").getBytes();

      assertEquals(expected, out.toByteArray());
View Full Code Here

Examples of org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshaller.marshal()

         delegate.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
         delegate.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);

         // marshall
         StringWriter strwr = new StringWriter();
         delegate.marshal(value, strwr);
         String xmlFragment = strwr.toString();

         log.debug("serialized: " + xmlFragment);
         return new BufferedStreamResult(xmlFragment);
      }
View Full Code Here

Examples of org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBMarshallerImpl.marshal()

      marshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
      marshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
      marshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());

      strwr = new StringWriter();
      marshaller.marshal(objArr, strwr);

      String was = strwr.toString();
      assertNotNull("Resulting fragment cannot be null", was);
      assertTrue("Resulting fragment cannot be empty", was.length() > 0);
View Full Code Here

Examples of org.jboss.xb.binding.AbstractMarshaller.marshal()

      // create an instance of Object Model Provider with no book
      ObjectModelProvider provider = new BookObjectProvider();

      // marshall Book instance passing it as an argument instead of using the one that is returned by the BookObjectProvider
      marshaller.marshal(getResourceUrl("xml/book/books.xsd").toString(), provider, book, xmlOutput);

      String xml = xmlOutput.getBuffer().toString();
      if(log.isTraceEnabled())
      {
         log.debug("marshalled with " + marshaller.getClass().getName() + ": " + xml);
View Full Code Here

Examples of org.jboss.xb.binding.DtdMarshaller.marshal()

      // create an instance of ObjectModelProvider with the book instance to be marshalled
      MappingObjectModelProvider provider = new MappingObjectModelProvider();
      provider.mapFieldToElement(Person.class, "dateOfBirth", "", "date-of-birth", SimpleTypeBindings.JAVA_UTIL_DATE);

      // marshal the book
      marshaller.marshal(dtdReader, provider, person, xmlOutput);

      // close DTD reader
      dtdReader.close();

      final String xml = xmlOutput.getBuffer().toString();
View Full Code Here

Examples of org.jboss.xb.binding.Marshaller.marshal()

      // create an instance of ObjectModelProvider with the book instance to be marshalled
      MappingObjectModelProvider provider = new MappingObjectModelProvider();
      provider.mapFieldToElement(Person.class, "dateOfBirth", "", "date-of-birth", SimpleTypeBindings.JAVA_UTIL_DATE);

      // marshal the book
      marshaller.marshal(dtdReader, provider, person, xmlOutput);

      // close DTD reader
      dtdReader.close();

      final String xml = xmlOutput.getBuffer().toString();
View Full Code Here

Examples of org.jboss.xb.binding.ObjectLocalMarshaller.marshal()

         else
         {
            ObjectLocalMarshaller marshaller = wildcard.getUnresolvedMarshaller();
            if(marshaller != null)
            {
               marshaller.marshal(ctx, o);
               return true;
            }
           
            String msg = "Failed to marshal wildcard: neither class mapping was found for "
               + o.getClass() + "@" + o.hashCode()
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.