Package org.switchyard.serial

Examples of org.switchyard.serial.Serializer.serialize()


*/
public final class RemoteMessageTest {

    private <T> T serDeser(T object, Class<T> clazz) throws Exception {
        Serializer ser = SerializerFactory.create(FormatType.JSON, null, true);
        byte[] bytes = ser.serialize(object, clazz);
        return ser.deserialize(bytes, clazz);
    }

    @Test
    public void testDOMProperty() throws Exception {
View Full Code Here


public final class ProtostuffComplexSerializationTest {

    private <T> T serDeser(T object, Class<T> clazz) throws Exception {
        Serializer ser = SerializerFactory.create(FormatType.JSON, null, true);
        //ser.setPrettyPrint(true);
        byte[] bytes = ser.serialize(object, clazz);
        //System.out.println(new String(bytes));
        return ser.deserialize(bytes, clazz);
    }

    @Test
View Full Code Here

public final class JacksonComplexSerializationTest {

    private <T> T serDeser(T object, Class<T> clazz) throws Exception {
        Serializer ser = SerializerFactory.create(FormatType.JSON, null, true);
        //ser.setPrettyPrint(true);
        byte[] bytes = ser.serialize(object, clazz);
        //System.out.println(new String(bytes));
        return ser.deserialize(bytes, clazz);
    }

    @Test
View Full Code Here

    private <T> T serDeser(T obj, Class<T> type) throws Exception {
        FormatType format = FormatType.JSON; //FormatType.XML_BEAN; //FormatType.SER_OBJECT;
        CompressionType compression = null; //CompressionType.ZIP; //CompressionType.GZIP;
        Serializer ser = SerializerFactory.create(format, compression, true);
        //ser.setPrettyPrint(true);
        byte[] bytes = ser.serialize(obj, type);
        //System.out.println(new String(bytes));
        return ser.deserialize(bytes, type);
    }

}
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.