Package org.json

Examples of org.json.JSONWriter.key()


                jw.key("members");
                jw.array();
                if (nodes != null) {
                    for (Node n : members) {
                        jw.object();
                        jw.key("id");
                        jw.value(n.getId());
                        jw.endObject();
                    }
                }
View Full Code Here


                        jw.endObject();
                    }
                }

                jw.endArray();
                jw.key("actions");
                jw.array();
                boolean enable = true;
                action(jw, enable, "removeNode", "Remove Node", "update");
                action(jw, enable, "deleteGroup", "Delete Group", "delete");
                jw.endArray();
View Full Code Here

            if (null != be)
            {
                final StringWriter s = new StringWriter();
                final Throwable t = be.getNestedException() != null ? be.getNestedException() : be;
                t.printStackTrace( new PrintWriter(s) );
                jw.key( "error" );
                jw.value( s.toString() );
            }

            jw.key( "status" );
            jw.value( statusLine );
View Full Code Here

                t.printStackTrace( new PrintWriter(s) );
                jw.key( "error" );
                jw.value( s.toString() );
            }

            jw.key( "status" );
            jw.value( statusLine );

            // add raw status
            jw.key( "s" );
            jw.array();
View Full Code Here

            jw.key( "status" );
            jw.value( statusLine );

            // add raw status
            jw.key( "s" );
            jw.array();
            for ( int i = 0; i < 5; i++ ) jw.value(status[i]);
            jw.endArray();

            jw.key( "data" );
View Full Code Here

            jw.key( "s" );
            jw.array();
            for ( int i = 0; i < 5; i++ ) jw.value(status[i]);
            jw.endArray();

            jw.key( "data" );

            jw.array();

            for ( int i = 0; i < bundles.length; i++ )
            {
View Full Code Here

    private void writeJSON(final PrintWriter pw) {
        final JSONWriter jw = new JSONWriter(pw);
        final Instance[] instances = adminService.getInstances();
        try {
            jw.object();
            jw.key("status");
            jw.value(getStatusLine());
            jw.key("instances");
            jw.array();
            for (Instance i : instances) {
                instanceInfo(jw, i);
View Full Code Here

        final Instance[] instances = adminService.getInstances();
        try {
            jw.object();
            jw.key("status");
            jw.value(getStatusLine());
            jw.key("instances");
            jw.array();
            for (Instance i : instances) {
                instanceInfo(jw, i);
            }
            jw.endArray();
View Full Code Here

        final JSONWriter jw = new JSONWriter(pw);

        try {
            jw.object();

            jw.key("status");
            jw.value(statusLine);

            jw.key("repositories");
            jw.array();
            for (Repository r : repositories) {
View Full Code Here

            jw.object();

            jw.key("status");
            jw.value(statusLine);

            jw.key("repositories");
            jw.array();
            for (Repository r : repositories) {
                jw.object();
                jw.key("name");
                jw.value(r.getName());
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.