Package com.thoughtworks.xstream

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


    xstream.aliasField( "host-string", HostKey.class, "hostString");

    Writer strWriter = new StringWriter();
    PrettyPrintWriter prettyPrintWriter = new PrettyPrintWriter( strWriter );

    xstream.marshal(configuration, prettyPrintWriter );

    System.out.println( strWriter.toString() );
  }
}
View Full Code Here


        }

        try {
            this.startDocument(true);
            for (Iterator i = source.iterator(); i.hasNext();) {
                xstream.marshal(i.next(), this);
            }
            this.endDocument(true);
        } catch (StreamException e) {
            if (e.getCause() instanceof SAXException) {
                throw (SAXException) (e.getCause());
View Full Code Here

        }

        XStream xstream = getXStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.aliasPackage("", "org.apache.activemq.command");
        xstream.marshal(ds, out);
        return buffer.toString();
    }

    // Properties
    // -------------------------------------------------------------------------
View Full Code Here

        if (classMetadata == null) {
          log.fatal("Can't init " + obj + " of type " + targetClass);
          continue;
        }
        // initalisierung des Objekts...
        defaultXStream.marshal(obj, new CompactWriter(new NullWriter()));

        if (preserveIds == false) {
          // Nun kann die ID gelöscht werden
          classMetadata.setIdentifier(obj, null, EntityMode.POJO);
        }
View Full Code Here

        }

        XStream xstream = getXStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.aliasPackage("", "org.apache.activemq.command");
        xstream.marshal(ds, out);
        return buffer.toString();
    }

    // Properties
    // -------------------------------------------------------------------------
View Full Code Here

        }

        XStream xstream = getXStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.aliasPackage("", "org.apache.activemq.command");
        xstream.marshal(ds, out);
        return buffer.toString();
    }

    // Properties
    // -------------------------------------------------------------------------
View Full Code Here

        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        XStream xstream = XStreamUtil.createXStream();
        xstream.marshal(gbeanDatas, writer);

//        FileWriter w = new FileWriter("target/foo.xml");
//        xstream.toXML(gbeanDatas, w);
//        w.close();
View Full Code Here

        // bind with the content handler
        SaxWriter writer = new SaxWriter();
        writer.setContentHandler(handler);

        // write out xml
        xstream.marshal(object, writer);
    }

    /**
     * Subclasses can override the XStream configuration here. By default XStream is setup to strip
     * package names, have tags starts with a capital letter, and flatten out collections
View Full Code Here

        // bind with the content handler
        SaxWriter writer = new SaxWriter();
        writer.setContentHandler(handler);

        // write out xml
        xstream.marshal(object, writer);
    }

    /**
     * Subclasses can override the XStream configuration here. By default XStream is setup to strip
     * package names, have tags starts with a capital letter, and flatten out collections
View Full Code Here

  }

  Element toXml(AbstractReportTable table){
    XStream          xs = ReportTableFactory.initXStream();
    JDomWriter        writer = new JDomWriter();
    xs.marshal(table, writer);
    Element      target = (Element) writer.getTopLevelNodes().get(0);
    target = Converter.asXStreamSubElement( target, REPORT_TABLE_ELEMENT_NAME, table.getClass());
    target.setAttribute(ATTRIBUTE_NAME_ID, String.valueOf(table.getType().getId()));
    return target;
  }
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.