Package com.thoughtworks.xstream

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


  public void write(final Workflow wf) {
    new Thread(new Runnable() {
      public void run() {
        XStream writer = new XStream(new StaxDriver());
        writer.autodetectAnnotations(true);
        String xml = writer.toXML(new WorkflowSaver(wf));
        File currentDirectory = null;
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setCurrentDirectory(currentDirectory);
        fileChooser.showSaveDialog(null);
View Full Code Here


        FileWriter fileWriter = null;
        try {
            fileWriter = new FileWriter(this.fileName + (this.nbOfFile == 0 ? ".log" : this.nbOfFile + ".log"), true );
            final XStream xstream = new XStream();
            for (LogEvent event : this.events) {
                fileWriter.write(xstream.toXML(event) + "\n");
            }
            if (split) {
                this.nbOfFile++;
                initialized = false;
            }
View Full Code Here

                               final String fileName) throws IOException {
        final XStream xstream = new XStream();

        final PrintWriter out = new PrintWriter( new BufferedWriter( new FileWriter( "src/test/resources/org/drools/reteoo/" + fileName ) ) );

        xstream.toXML( ruleBase,
                       out );
    }

    private void checkRuleBase(final String name) throws Exception {
        final PackageBuilder builder = new PackageBuilder();
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

        XStreamConfigurator.addFieldAliases(fieldAliases, xstream);
        XStreamConfigurator.addImplicitCollections(implicitCollections, xstream);
        XStreamConfigurator.addConverters(converters, xstream);
       
        try {
            String xml = xstream.toXML(object);
            payloadProxy.setPayload(message, xml);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }
View Full Code Here

        System.out.println("");
        System.out.println("------------Http Request Info (XStream Encoded)-------------------");
        String requestInfoXML;

        XStream xstream = new XStream();
        requestInfoXML = xstream.toXML(requestInfo);

        System.out.println(requestInfoXML);

        System.out.println("------------Http Request body -------------------");
    System.out.println(httpPayload);
View Full Code Here

                final ComponentAdapter componentAdapter = prepSER_isXStreamSerializable(picoContainer);
                assertSame(getComponentAdapterType(), componentAdapter.getClass());
                final Object instance = componentAdapter.getComponentInstance(picoContainer);
                assertNotNull(instance);
                final XStream xstream = new XStream(new XppDriver());
                final String xml = xstream.toXML(componentAdapter);
                final ComponentAdapter serializedComponentAdapter = (ComponentAdapter) xstream.fromXML(xml);
                assertEquals(componentAdapter.getComponentKey(), serializedComponentAdapter.getComponentKey());
                final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(picoContainer);
                assertNotNull(instanceAfterSerialization);
                assertSame(instance.getClass(), instanceAfterSerialization.getClass());
View Full Code Here

    public Representation makeRepresentation(final Object data) {
        return new OutputRepresentation(MediaType.APPLICATION_XML){
            public void write(OutputStream outputStream){
                XStream xstream = getXStream();
                xstream.toXML(data, outputStream);
            }
        };
    }

    public Object readRepresentation(Representation representation) {
View Full Code Here

    public static boolean writeConfigToDisk(ProxyConfig pc) {
        try {
            File proxyConfFile = getConfigFile();
            XStream xs = new XStream();
            String xml = xs.toXML(pc);
            FileWriter fw = new FileWriter(proxyConfFile, false); // false means overwrite old file
            //Take the write lock on the file & lock it
            configWriteLock.lock();
            fw.write(xml);
            fw.close();
View Full Code Here

    OgrFormat[] formats;
   
    public static void main(String[] args) {
        // generates the default configuration xml and prints it to the output
        XStream xstream = Ogr2OgrConfigurator.buildXStream();
        System.out.println(xstream.toXML(OgrConfiguration.DEFAULT));
    }
}
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.