Package com.thoughtworks.xstream

Examples of com.thoughtworks.xstream.XStream.toXML()


          _metadataFolder.create(true, true, new NullProgressMonitor())
          _metadataFile = _metadataFolder.getFile(_tmlFile.getName().substring(0, _tmlFile.getName().length() - _tmlFile.getFileExtension().length()) + "metadata.xml");
        }

        writer = new OutputStreamWriter(new FileOutputStream(_metadataFile.getLocation().toFile()), _fileEncoding);
        xstream.toXML(metaData, writer);
       
      } catch (CoreException e) {
        IOException ioe = new IOException("Unable to save metadata file '" + _metadataFile.getLocation() + "'.");
        ioe.setStackTrace(e.getStackTrace());
        throw ioe;
View Full Code Here


                ModelAndView modelAndView = controller.handleRequest(request, response);
                if (modelAndView.getModel() != null) {
                    TransportableModel tm = new TransportableModel();
                    tm.putAll(modelAndView.getModel());
                    XStream x = new XStream();
                    x.toXML(tm, response.getWriter());
                }
        }
        return null;
    }
}
View Full Code Here

        XStream xstream = new XStream();
        XBirdCollectionStrategy<String, Object> strategy = new XBirdCollectionStrategy<String, Object>(COLLECTION_NAME, xstream);
        xstream.processAnnotations(RendezvousMessage.class);

        RendezvousMessage msg1 = new RendezvousMessage(15, Arrays.asList(new Author("anonymous"), new Author("makoto")));
        System.out.println(xstream.toXML(msg1));
        System.out.println();

        RendezvousMessage msg2 = new RendezvousMessage(15, Arrays.asList(new Author("anonymous")), "firstPart", "secondPart");
        System.out.println(xstream.toXML(msg2));
        System.out.println();
View Full Code Here

        RendezvousMessage msg1 = new RendezvousMessage(15, Arrays.asList(new Author("anonymous"), new Author("makoto")));
        System.out.println(xstream.toXML(msg1));
        System.out.println();

        RendezvousMessage msg2 = new RendezvousMessage(15, Arrays.asList(new Author("anonymous")), "firstPart", "secondPart");
        System.out.println(xstream.toXML(msg2));
        System.out.println();

        List<RendezvousMessage> list = new XmlArrayList(strategy);
        list.add(msg1);
        list.add(msg2);
View Full Code Here

        xstream.processAnnotations(RendezvousMessage.class);
        xstream.processAnnotations(Author.class);

        List<Author> author1 = Arrays.asList(new Author("anonymous"));
        RendezvousMessage msg1 = new RendezvousMessage(15, author1);
        System.out.println(xstream.toXML(msg1));
        System.out.println();

        List<Author> author2 = Arrays.asList(new Author("makoto"), new Author("leo"), new Author("grun"));
        RendezvousMessage msg2 = new RendezvousMessage(15, author2, "firstPart", "secondPart");
        System.out.println(xstream.toXML(msg2));
View Full Code Here

        System.out.println(xstream.toXML(msg1));
        System.out.println();

        List<Author> author2 = Arrays.asList(new Author("makoto"), new Author("leo"), new Author("grun"));
        RendezvousMessage msg2 = new RendezvousMessage(15, author2, "firstPart", "secondPart");
        System.out.println(xstream.toXML(msg2));
        System.out.println();

        List<RendezvousMessage> list = new XmlArrayList(strategy);
        list.add(msg1);
        list.add(msg2);
View Full Code Here

          throw new IOException(je.getMessage());
        }
      }
      else{
        XStream xstream=XStreamDispenser.getXMLXStream();
        writer.write(xstream.toXML(result));
      }
      return null;
    } catch (BrowseException e) {
      throw new ServletException(e.getMessage(),e);
    }
View Full Code Here

          throw new IOException(je.getMessage());
        }
      }
      else{
        XStream xstream=XStreamDispenser.getXMLXStream();
        writer.write(xstream.toXML(result));
      }
     
     
     
    } catch (BrowseException e) {
View Full Code Here

        // now query both addresses
        System.out.println( "querying Jimmys address..." );
        Address adrJimmy = addressBook.getAddressFromName( "Jimmy Who" );
        System.out.println( "Jimmys address: " );
        XStream xstream = new XStream();
        System.out.println( xstream.toXML( adrJimmy ) );

        System.out.println( "" );

        System.out.println( "querying Janes address..." );
        Address adrJane = addressBook.getAddressFromName( "Jane Who" );
View Full Code Here

        System.out.println( "" );

        System.out.println( "querying Janes address..." );
        Address adrJane = addressBook.getAddressFromName( "Jane Who" );
        System.out.println( "Janes address: " );
        System.out.println( xstream.toXML( adrJane ) );
    }
}
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.