Package com.thoughtworks.xstream

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


                    DefaultRemoteInvocationExecutor executor = new DefaultRemoteInvocationExecutor();
                    Object result = executor.invoke((RemoteInvocation) rmi, person);

                    // Convert result to an rmi invocation
                    RemoteInvocationResult rmiResult = new RemoteInvocationResult(result);
                    out.setContent(new StringSource(xstream.toXML(rmiResult)));
                } catch (Exception e) {
                    throw new MessagingException(e);
                }

                return true;
View Full Code Here


     */
    private Source marshal(InputStream is) throws IOException, ClassNotFoundException {
        Object obj = new ObjectInputStream(is).readObject();
        Writer w = new StringWriter();
        XStream xstream = new XStream(new DomDriver());
        xstream.toXML(obj, w);
        String request = w.toString();

        if (log.isDebugEnabled()) {
            log.debug("Remote invocation request: " + request);
        }
View Full Code Here

        MetaObject mj = new MetaObjectImpl(source);
        OMElement element = null;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XStream xs = new XStream();
        xs.alias("xobject", mj.getClass());
        xs.toXML(mj, out);
        /* TODO: Maybe a base64 conversion...? or not?
         *  ie. new ByteArrayInputStream(Utils.toBase64(out.toByteArray()).getBytes())
         */
        try {
            // what's better this one:
View Full Code Here

public class XStreamHandler implements ContentTypeHandler {

    public String fromObject(Object obj, String resultCode, Writer out) throws IOException {
        if (obj != null) {
            XStream xstream = createXStream();
            xstream.toXML(obj, out);
        }
        return null;
    }

    public void toObject(Reader in, Object target) {
View Full Code Here

                    currentXStream.alias( name, List.class );
                }
            }
        }

        return currentXStream.toXML( obj );
    }

    /**
     * @return lazy loading xstream object.
     */
 
View Full Code Here

        suite.setErrors(result.getNumberOfErrors());
        suite.setFailures(result.getNumberOfFailures());
        suite.setTests(result.getNumberOfTests());
        suite.setTime(result.getTime());
        suite.setSkipped(result.getNumberOfSkipped());
        out.print(xStream.toXML(suite));
    }

    private List<Property> dumpProperties(Properties properties)
    {
        ArrayList<Property> testProperties = new ArrayList<Property>();
View Full Code Here

                       org.drools.verifier.components.Field.class );

        xstream.alias( "LiteralRestriction",
                       LiteralRestriction.class );

        out.write( ("<?xml version=\"1.0\"?>\n" + xstream.toXML( result )).getBytes( IoUtils.UTF8_CHARSET ) );
    }

}
View Full Code Here

        return result.toByteArray();
    }

    private byte[] toXML(Fact[] facts) {
        XStream x = new XStream(new DomDriver());
        return x.toXML(facts).getBytes(IoUtils.UTF8_CHARSET);

    }

    public Fact[] loadMetaModel(JarInputStream jis) throws Exception {
        JarEntry entry = null;
View Full Code Here

    if (conflicts != null) {
      XStream xstream = new XStream();
      xstream.setMode(XStream.NO_REFERENCES);
      OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(new File(ConfigMain.getParameter("tempfolder") + conflictFilename)),
          "UTF8");
      xstream.toXML(conflicts, fw);
    }
    logger.debug("Neue Prozesse: " + newProj);
    logger.debug("Zu " + oldProj + " existierenden Prozessen wurden Properties hinzugefügt");
  }
View Full Code Here

            synchronized ( this.events ) {
                log = new WorkingMemoryLog(new ArrayList<LogEvent>( this.events ),
                                           isPhreak ? "PHREAK" : "RETEOO");
                clear();
            }
            writer.write( xstream.toXML( log ) + "\n" );
        } catch ( final FileNotFoundException exc ) {
            throw new RuntimeException( "Could not create the log file.  Please make sure that directory that the log file should be placed in does exist." );
        } catch ( final Throwable t ) {
            logger.error("error", t);
        } finally {
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.