Package org.apache.wink.json4j.compat

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


            JSONWriter jWriter = factory.createJSONWriter(w);
            jWriter.object();
            jWriter.key("foo");
            jWriter.array();
            jWriter.value(true);
            jWriter.endArray();
            jWriter.endObject();
            jWriter.close();
            String str = w.toString();

            // Verify it parses.
View Full Code Here


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

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

            jWriter.close();
View Full Code Here

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

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

            jWriter.close();
View Full Code Here

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

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

            jWriter.close();
            String str = w.toString();

            // Verify it parses.
View Full Code Here

            JSONWriter jWriter = factory.createJSONWriter(w);
            jWriter.array();
            jWriter.close();

            // This should die.
            jWriter.endArray();
        }catch(Exception ex1){
            ex = ex1;
        }
        assertTrue(ex instanceof IllegalStateException);
    }
View Full Code Here

            StringWriter w = new StringWriter();
            System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
            JSONFactory factory = JSONFactory.newInstance();
            JSONWriter jWriter = factory.createJSONWriter(w);
            jWriter.array();
            jWriter.endArray();
            String str = w.toString();
            // Verify it parses.
            JSONArray test = factory.createJSONArray(str);
            assertTrue(str.equals("[]"));
        }catch(Exception ex1){
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.