Examples of createMarshaller()


Examples of org.jboss.resteasy.plugins.providers.jaxb.json.BadgerContext.createMarshaller()

      library.setBooks(books);

      {
         BadgerContext context = new BadgerContext(Library.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(library, writer);
         System.out.println("Badger: ");
         String s = writer.toString();
         System.out.println(s);
         Library lib = (Library) context.createUnmarshaller().unmarshal(new StringReader(s));
         Assert.assertEquals(lib.getName(), "BPL");
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.jaxb.json.BadgerContext.createMarshaller()

         Assert.assertEquals(lib.getBooks().size(), 2);
      }
      {
         JettisonMappedContext context = new JettisonMappedContext(Library.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(library, writer);
         System.out.println("Mapped: ");
         String s = writer.toString();
         System.out.println(s);
         Library lib = (Library) context.createUnmarshaller().unmarshal(new StringReader(s));
         Assert.assertEquals(lib.getName(), "BPL");
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.jaxb.json.JettisonMappedContext.createMarshaller()

   public String getBooksMappedText() throws Exception
   {
      BookListing listing = getListing();
      JettisonMappedContext context = new JettisonMappedContext(BookListing.class);
      StringWriter writer = new StringWriter();
      Marshaller marshaller = context.createMarshaller();
      marshaller.marshal(listing, writer);
      return writer.toString();
   }

View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.jaxb.json.JettisonMappedContext.createMarshaller()

   {
      {
         Mapped mapped = TestJAXB.class.getMethod("testJSON").getAnnotation(Mapped.class);
         JettisonMappedContext context = new JettisonMappedContext(mapped, Book.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(new Book("Bill Burke", "666", "EJB 3.0"), writer);
         System.out.println("Mapped: ");
         String val = writer.toString();
         System.out.println(val);

         // test Mapped attributeAsElement
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.jaxb.json.JettisonMappedContext.createMarshaller()

         Assert.assertTrue(val.indexOf("@title") == -1);
      }
      {
         BadgerContext context = new BadgerContext(Book.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(new Book("Bill Burke", "666", "EJB 3.0"), writer);
         System.out.println("Badger: ");
         System.out.println(writer.toString());
      }
      Library library = new Library();
      ArrayList<Book> books = new ArrayList<Book>();
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.jaxb.json.JettisonMappedContext.createMarshaller()

      library.setBooks(books);

      {
         BadgerContext context = new BadgerContext(Library.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(library, writer);
         System.out.println("Badger: ");
         String s = writer.toString();
         System.out.println(s);
         Library lib = (Library) context.createUnmarshaller().unmarshal(new StringReader(s));
         Assert.assertEquals(lib.getName(), "BPL");
View Full Code Here

Examples of org.jboss.resteasy.plugins.providers.jaxb.json.JettisonMappedContext.createMarshaller()

         Assert.assertEquals(lib.getBooks().size(), 2);
      }
      {
         JettisonMappedContext context = new JettisonMappedContext(Library.class);
         StringWriter writer = new StringWriter();
         context.createMarshaller().marshal(library, writer);
         System.out.println("Mapped: ");
         String s = writer.toString();
         System.out.println(s);
         Library lib = (Library) context.createUnmarshaller().unmarshal(new StringReader(s));
         Assert.assertEquals(lib.getName(), "BPL");
View Full Code Here

Examples of org.jbpm.designer.web.profile.IDiagramProfile.createMarshaller()

        } else if(actionParam != null && actionParam.equals("checkErrors")) {
          String retValue = "false";
          IDiagramProfile profile = _profileService.findProfile(req, req.getParameter("profile"));
            String json = req.getParameter("data");
            try {
        String xmlOut = profile.createMarshaller().parseModel(json, preProcessingParam);
        String jsonIn = profile.createUnmarshaller().parseModel(xmlOut, profile, preProcessingParam);
        if(jsonIn == null || jsonIn.length() < 1) {
          retValue = "true";
        }
      } catch (Throwable t) {
View Full Code Here

Examples of org.platformlayer.xml.JaxbHelper.createMarshaller()

    JaxbHelper jaxbHelper = JaxbHelper.get(item.getClass());

    StringWriter writer = new StringWriter();
    try {
      Marshaller marshaller = jaxbHelper.createMarshaller();

      // OpsSecretEncryptionStrategy strategy = new OpsSecretEncryptionStrategy(itemSecret);
      // strategy.setAdapter(marshaller);

      marshaller.marshal(mutableItem, 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.