Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.XppDriver


public class XStreamLocalAttributeAliases implements Product {

    private final XStream xstream;

    public XStreamLocalAttributeAliases() {
        this.xstream = new XStream(new XppDriver());
        try {
            Class clsFields = Class.forName(A100Fields.class.getName());
            for (int i = 0; i < 100; ++i) {
                String no = "00" + i;
                no = no.substring(no.length() - 3);
View Full Code Here


    private final XStream xstream;
    private final int bufferIncrement;

    public IterativeAppender(int bufferIncrement) {
        this.bufferIncrement = bufferIncrement;
        this.xstream = new XStream(new XppDriver(new XmlFriendlyReplacer(bufferIncrement)));
    }
View Full Code Here

    public synchronized static void saveSampleResult(SampleEvent evt, Writer writer) throws IOException {
        DataHolder dh = JTLSAVER.newDataHolder();
        dh.put(SAMPLE_EVENT_OBJECT, evt);
        // This is effectively the same as saver.toXML(Object, Writer) except we get to provide the DataHolder
        // Don't know why there is no method for this in the XStream class
        JTLSAVER.marshal(evt.getResult(), new XppDriver().createWriter(writer), dh);
        writer.write('\n');
    }
View Full Code Here

        InputStreamReader inputStreamReader = getInputStreamReader(reader);
        DataHolder dh = JTLSAVER.newDataHolder();
        dh.put(RESULTCOLLECTOR_HELPER_OBJECT, resultCollectorHelper); // Allow TestResultWrapper to feed back the samples
        // This is effectively the same as saver.fromXML(InputStream) except we get to provide the DataHolder
        // Don't know why there is no method for this in the XStream class
        JTLSAVER.unmarshal(new XppDriver().createReader(reader), null, dh);
        inputStreamReader.close();
    }
View Full Code Here

     * match for the {@link ReflectionProvider} on its own.
     *
     * @throws InitializationException in case of an initialization problem
     */
    public XStream() {
        this(null, (Mapper)null, new XppDriver());
    }
View Full Code Here

     * Constructs an XStream with a special {@link ReflectionProvider}. The instance will use the {@link XppDriver} as default.
     *
     * @throws InitializationException in case of an initialization problem
     */
    public XStream(ReflectionProvider reflectionProvider) {
        this(reflectionProvider, (Mapper)null, new XppDriver());
    }
View Full Code Here

     * @since 1.2
     * @see #toXML(XStream, Object, Writer)
     */
    public Object fromXML(Reader xml)
            throws IOException, ClassNotFoundException {
        return fromXML(new XppDriver(), xml);
    }
View Full Code Here

    {
      xmlWriter = new IndentingXMLStreamWriter(XMLOutputFactory.newInstance().createXMLStreamWriter(writer));
      xmlWriter.writeStartDocument("UTF-8", "1.0");
      xmlWriter.setDefaultNamespace("http://plugins.intellij.net/revu");
      xstreamDataHolder.put(ReviewExternalizerXmlImpl.CONTEXT_KEY_REVIEW, null);
      xstream.marshal(review, new XppDriver().createWriter(writer), xstreamDataHolder);
    }
    catch (XMLStreamException e)
    {
      throw new RevuException("Failed to serialize review: " + review, e);
    }
View Full Code Here

    public synchronized static void saveSampleResult(SampleEvent evt, Writer writer) throws IOException {
        DataHolder dh = JTLSAVER.newDataHolder();
        dh.put(SAMPLE_EVENT_OBJECT, evt);
        // This is effectively the same as saver.toXML(Object, Writer) except we get to provide the DataHolder
        // Don't know why there is no method for this in the XStream class
        JTLSAVER.marshal(evt.getResult(), new XppDriver().createWriter(writer), dh);
        writer.write('\n');
    }
View Full Code Here

        InputStreamReader inputStreamReader = getInputStreamReader(reader);
        DataHolder dh = JTLSAVER.newDataHolder();
        dh.put(RESULTCOLLECTOR_HELPER_OBJECT, resultCollectorHelper); // Allow TestResultWrapper to feed back the samples
        // This is effectively the same as saver.fromXML(InputStream) except we get to provide the DataHolder
        // Don't know why there is no method for this in the XStream class
        JTLSAVER.unmarshal(new XppDriver().createReader(reader), null, dh);
        inputStreamReader.close();
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.XppDriver

Copyright © 2018 www.massapicom. 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.