Package org.apache.wink.json4j.compat

Examples of org.apache.wink.json4j.compat.JSONStringer.endArray()


        try{
            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
            JSONFactory factory = JSONFactory.newInstance();
            JSONStringer jStringer = factory.createJSONStringer();
            jStringer.array();
            jStringer.endArray();
            String str = jStringer.toString();
            // Verify it parses.
            JSONArray test = factory.createJSONArray(str);
            assertTrue(str.equals("[]"));
        }catch(Exception ex1){
View Full Code Here


            jStringer.key("array");
            jStringer.array();
            jStringer.value(1);
            jStringer.value((double)2);
            jStringer.value((short)3);
            jStringer.endArray();

            //Close top object.
            jStringer.endObject();

            String str = jStringer.toString();
View Full Code Here

            // Place an array
            jStringer.array();
            jStringer.value(1);
            jStringer.value((double)2);
            jStringer.value((short)3);
            jStringer.endArray();

            //Close top array.
            jStringer.endArray();

            String str = jStringer.toString();
View Full Code Here

            jStringer.value((double)2);
            jStringer.value((short)3);
            jStringer.endArray();

            //Close top array.
            jStringer.endArray();

            String str = jStringer.toString();

            // Verify it parses.
            JSONArray test = factory.createJSONArray(str);
View Full Code Here

            JSONStringer jStringer = factory.createJSONStringer();
            jStringer.array();
            jStringer.toString();

            // This should die.
            jStringer.endArray();
        }catch(Exception ex1){
            ex = ex1;
        }
        assertTrue(ex instanceof IllegalStateException);
    }
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.