Examples of marshalObject()


Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        System.out.println("testGenericArray");
        MyArray<Book<String>> bookList = new MyArray<Book<String>>();
        bookList.add(new RatedBook<String>("John Marsden", "Tomorrow When The War Began", "ISBN-0192-2928", QUALITY.GOOD));
        bookList.add(new RatedBook<String>("David Johnsonbaugh", "Discrete Mathematics", "ISBN-0192-2928", QUALITY.BAD));
        JavaMarshaler marshaler = new JavaMarshaler();
        Value output = marshaler.marshalObject(bookList);
        Value expected = JSON.parse("{\"$innerArray\":[{\"$innerArray\":[{\"$innerArray\":[],\"author\":\"John Marsden\",\"title\":\"Tomorrow When The War Began\",\"test\":-99,\"quality\":\"GOOD\"},{\"$innerArray\":[],\"author\":\"David Johnsonbaugh\",\"title\":\"Discrete Mathematics\",\"test\":-99,\"quality\":\"BAD\"},{\"$innerArray\":[\"A String\"],\"author\":\"R.A.Salvatore\",\"title\":\"Homeland\",\"iSBN\":\"ISBN-0192-2928\",\"test\":-99,\"quality\":\"GOOD\"}],\"value\":100}],\"someValue\":\"this is a string\"}\n").getRoot();
        System.out.println(output.toJSON());
        //assertEquals(output, expected);
    }
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        bookList.add(new RatedBook<String>("David Johnsonbaugh", "Discrete Mathematics", QUALITY.BAD));
        bookList.add(book);
        bookBookList.add(bookList);

        JavaMarshaler marshaler = new JavaMarshaler();
        Value output = marshaler.marshalObject(bookBookList);
        System.out.println(output.toJSON());
    }

    @Test
    public void testNestedGenericMap() throws JSONMarshalerException {
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        innerMap = new MyMap2<java.lang.String, Integer>();
        innerMap.put("blah", 69);
        mapObject.put("innerMap2", innerMap);

        JavaMarshaler marshaler = new JavaMarshaler();
        Value output = marshaler.marshalObject(mapObject);
        System.out.println(output.toJSON());
    }

    public class MyOuterArray<S extends MyArray<?>> extends ArrayList<S> {
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        book.setOwner(owner);
        owner.setBook(book);

        System.out.println("0 nested levels");
        JavaMarshaler marshaler = new JavaMarshaler();
        Value output = marshaler.marshalObject(book);
        System.out.println(output.toJSON());

        output = marshaler.marshalObject(owner);
        System.out.println(output.toJSON());
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        System.out.println("0 nested levels");
        JavaMarshaler marshaler = new JavaMarshaler();
        Value output = marshaler.marshalObject(book);
        System.out.println(output.toJSON());

        output = marshaler.marshalObject(owner);
        System.out.println(output.toJSON());

        System.out.println("1 nested level");
        JSONMarshaler.setCycleLevels(1);
        marshaler = new JavaMarshaler();
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        System.out.println(output.toJSON());

        System.out.println("1 nested level");
        JSONMarshaler.setCycleLevels(1);
        marshaler = new JavaMarshaler();
        output = marshaler.marshalObject(book);
        System.out.println(output.toJSON());

        output = marshaler.marshalObject(owner);
        System.out.println(output.toJSON());
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        JSONMarshaler.setCycleLevels(1);
        marshaler = new JavaMarshaler();
        output = marshaler.marshalObject(book);
        System.out.println(output.toJSON());

        output = marshaler.marshalObject(owner);
        System.out.println(output.toJSON());

        System.out.println("2 nested levels");
        JSONMarshaler.setCycleLevels(2);
        marshaler = new JavaMarshaler();
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        System.out.println(output.toJSON());

        System.out.println("2 nested levels");
        JSONMarshaler.setCycleLevels(2);
        marshaler = new JavaMarshaler();
        output = marshaler.marshalObject(book);
        System.out.println(output.toJSON());

        output = marshaler.marshalObject(owner);
        System.out.println(output.toJSON());
    }
View Full Code Here

Examples of cc.plural.jsonij.marshal.JavaMarshaler.marshalObject()

        JSONMarshaler.setCycleLevels(2);
        marshaler = new JavaMarshaler();
        output = marshaler.marshalObject(book);
        System.out.println(output.toJSON());

        output = marshaler.marshalObject(owner);
        System.out.println(output.toJSON());
    }

    public static class Owner {
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.