Package com.thoughtworks.xstream

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


            @Override
            protected void write(Object data, OutputStream output)
                    throws IOException {
                XStream xstream = new XStream();
                xstream.alias( "featureTypeName", String.class);
                xstream.toXML( data, output );
            }
        };
    }
   
    @Override
View Full Code Here


  {
    XStream xstream = new XStream(new DomDriver());
   
    try {
      FileWriter fw = new FileWriter(p);
           xstream.toXML( this , fw );
        }
    catch (IOException ex) {
        JOptionPane.showMessageDialog( null, ex.getMessage());
        return false;
        }
View Full Code Here

    public static void writeObject(final String path, Object obj)
    {
      XStream xstream = new XStream(new DomDriver());
      try {
        FileWriter fw = new FileWriter(path);
             xstream.toXML( obj, fw );
          }
      catch (IOException ex) {
          JOptionPane.showMessageDialog( null, "Could not write object:\n"+ex.getMessage());
          }
          catch(XStreamException ex){
View Full Code Here

    }

    private void saveAsXML(String name, AST ast) {
        XStream xstream = new XStream();
        try {
            xstream.toXML(ast, new FileWriter(name + ".antlr.xml"));
            System.out.println("Written AST to " + name + ".antlr.xml");
        }
        catch (Exception e) {
            System.out.println("Couldn't write to " + name + ".antlr.xml");
            e.printStackTrace();
View Full Code Here

    }

    private void saveAsXML(String name, ModuleNode ast) {
        XStream xstream = new XStream();
        try {
            xstream.toXML(ast,new FileWriter(name + ".xml"));
            System.out.println("Written AST to " + name + ".xml");
        } catch (Exception e) {
            System.out.println("Couldn't write to " + name + ".xml");
            e.printStackTrace();
        }
View Full Code Here

    }

    private void saveAsXML(String name, AST ast) {
        XStream xstream = new XStream();
        try {
            xstream.toXML(ast, new FileWriter(name + ".antlr.xml"));
            System.out.println("Written AST to " + name + ".antlr.xml");
        }
        catch (Exception e) {
            System.out.println("Couldn't write to " + name + ".antlr.xml");
            e.printStackTrace();
View Full Code Here

     */
    protected String marshallAdvisory(final DataStructure ds) {
        XStream xstream = new XStream(new JsonHierarchicalStreamDriver());
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.aliasPackage("", "org.apache.activemq.command");
        return xstream.toXML(ds);
    }
}
View Full Code Here

   
    System.out.println (graph.toString());
   
    XStream xs = new XStream();
    xs.alias("graph", Graph.class);
    String test = xs.toXML(graph);
    System.out.println(test);
    graph = (Graph<Integer>) xs.fromXML(test);
       
    System.out.println(graph);
  }
View Full Code Here

      response.setHeader("Content-disposition", "inline; filename=or-report-export.xml");
      response.setContentType("application/xml");
         
      ServletOutputStream outputStream = response.getOutputStream();
     
      xStream.toXML(selectedReports, outputStream);
     
      outputStream.flush();
      outputStream.close();
     
      return NONE;
View Full Code Here

        {
            FileOutputStream file = new FileOutputStream(directoryProvider.getReportGenerationDirectory() + fileName + ".xml");

            XStream xStream = new XStream();
            xStream.alias("reportGenerationInfo", DeliveredReport.class);
            xStream.toXML(info, file);
       
            file.flush();
            file.close();
        }
        catch(IOException ioe)
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.