Package com.thoughtworks.xstream.io.json

Examples of com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver


    }
   
    public void testStreamDriverTransform() throws Exception {
      org.apache.activemq.util.oxm.XStreamMessageTransformer transformer = new org.apache.activemq.util.oxm.XStreamMessageTransformer();
        transformer.setTransformType(ADAPTIVE);
      transformer.setStreamDriver(new JettisonMappedXmlDriver());
        connectionFactory.setTransformer(transformer);
        connection = connectionFactory.createConnection();
        connection.start();

        // lets create the consumers
View Full Code Here


public class XStreamJSon {
    public static volatile boolean SORT_MAPS = false;

    public static XStream newJSonMarshaller() {
        JettisonMappedXmlDriver jet = new JettisonMappedXmlDriver();
        XStream xstream = new XStream( jet );

        XStreamHelper.setAliases( xstream );

        xstream.alias( "commands",
View Full Code Here

import java.util.Map;
import java.util.Map.Entry;

public class XStreamJSon {
    public static XStream newJSonMarshaller() {
        JettisonMappedXmlDriver jet = new JettisonMappedXmlDriver();
        XStream xstream = new XStream( jet );

        XStreamHelper.setAliases( xstream );

        xstream.alias( "commands",
View Full Code Here

    private String contentType = "application/xml";

    public XStreamView(String format) {
        if (format.equals("json")) {
            contentType = "application/json";
            xstream = new XStream(new JettisonMappedXmlDriver());
        } else if (format.equals("xml")) {
            contentType = "application/xml";
            xstream = new XStream();
        }
        configureXStream();
View Full Code Here

import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
import com.thoughtworks.xstream.mapper.Mapper;

public class XStreamJSon {
    public static XStream newJSonMarshaller() {
        JettisonMappedXmlDriver jet = new JettisonMappedXmlDriver();
        XStream xstream = new XStream( jet );

        XStreamHelper.setAliases( xstream );

        xstream.alias( "commands",
View Full Code Here

import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
import com.thoughtworks.xstream.mapper.Mapper;

public class XStreamJSon {
    public static XStream newJSonMarshaller() {
        JettisonMappedXmlDriver jet = new JettisonMappedXmlDriver();
        XStream xstream = new XStream( jet );

        XStreamHelper.setAliases( xstream );

        xstream.alias( "commands",
View Full Code Here

                case JMS_OBJECT_XML:
                    in = new XppReader(new StringReader(text), XppFactory.createDefaultParser());
                    msg = createObjectMessage(in);
                    break;
                case JMS_OBJECT_JSON:
                    in = new JettisonMappedXmlDriver().createReader(new StringReader(text));
                    msg = createObjectMessage(in);
                    break;
                case JMS_MAP_XML:
                    in = new XppReader(new StringReader(text), XppFactory.createDefaultParser());
                    msg = createMapMessage(in);
                    break;
                case JMS_MAP_JSON:
                    in = new JettisonMappedXmlDriver().createReader(new StringReader(text));
                    msg = createMapMessage(in);
                    break;
                default:
                    throw new Exception("Unkown transformation: " + transformation);
                }
View Full Code Here

    protected String marshall(Serializable object, String transformation)
            throws JMSException {
        StringWriter buffer = new StringWriter();
        HierarchicalStreamWriter out;
        if (transformation.toLowerCase().endsWith("json")) {
            out = new JettisonMappedXmlDriver(new Configuration(), false).createWriter(buffer);
        } else {
            out = new PrettyPrintWriter(buffer);
        }
        getXStream().marshal(object, out);
        return buffer.toString();
View Full Code Here

    protected String marshallAdvisory(final DataStructure ds, String transformation) {

        StringWriter buffer = new StringWriter();
        HierarchicalStreamWriter out;
        if (transformation.toLowerCase().endsWith("json")) {
            out = new JettisonMappedXmlDriver().createWriter(buffer);
        } else {
            out = new PrettyPrintWriter(buffer);
        }

        XStream xstream = getXStream();
View Full Code Here

     */
    XStream xstream;
   
    public ReflectiveJSONFormat() {
        super(MediaType.APPLICATION_JSON);
        this.xstream = new XStream(new JettisonMappedXmlDriver());
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver

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.