Package org.json

Examples of org.json.JSONWriter.object()


                        }
                    }
                   
                    writer.array();
                    if (id != null) {
                        writer.object();
                        writer.key("id"); writer.value(id);
                        writer.key("name"); writer.value(topicName);
                        writer.endObject();
                    } else {
                        writer.value("<not reconciled>");
View Full Code Here


            throws ServletException, IOException {

        Writer w = response.getWriter();
        JSONWriter writer = new JSONWriter(w);
        try {
            writer.object();
            writer.key("config"); ImportingManager.writeConfiguration(writer, new Properties());
            writer.endObject();
        } catch (JSONException e) {
            throw new ServletException(e);
        } finally {
View Full Code Here

            String query = null;
            {
                StringWriter stringWriter = new StringWriter();
                JSONWriter jsonWriter = new JSONWriter(stringWriter);
               
                jsonWriter.object();
                jsonWriter.key("query");
                jsonWriter.array();
                jsonWriter.object();

                jsonWriter.key("id"); jsonWriter.value(null);
View Full Code Here

                JSONWriter jsonWriter = new JSONWriter(stringWriter);
               
                jsonWriter.object();
                jsonWriter.key("query");
                jsonWriter.array();
                jsonWriter.object();

                jsonWriter.key("id"); jsonWriter.value(null);
                jsonWriter.key("name"); jsonWriter.value(null);
                jsonWriter.key("guid"); jsonWriter.value(null);
                jsonWriter.key("type"); jsonWriter.array(); jsonWriter.endArray();
View Full Code Here

    protected void saveToFile(File file) throws IOException, JSONException {
        FileWriter writer = new FileWriter(file);
        try {
            JSONWriter jsonWriter = new JSONWriter(writer);
            jsonWriter.object();
            jsonWriter.key("projectIDs");
            jsonWriter.array();
            for (Long id : _projectsMetadata.keySet()) {
                ProjectMetadata metadata = _projectsMetadata.get(id);
                if (metadata != null) {
View Full Code Here

        throws IOException {
   
        Writer w = response.getWriter();
        try {
            JSONWriter writer = new JSONWriter(w);
            writer.object();
            writer.key("status"); writer.value(status);
            writer.key("message"); writer.value(message);
            writer.endObject();
            w.flush();
            w.close();
View Full Code Here

            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            JSONWriter writer = new JSONWriter(response.getWriter());
           
            writer.object();
           
            for (String key : ps.getKeys()) {
                Object pref = ps.get(key);
                if (pref == null || pref instanceof String || pref instanceof Number || pref instanceof Boolean) {
                    writer.key(key);
View Full Code Here

                Pool pool = new Pool();
                Properties options = new Properties();
                options.put("pool", pool);

                writer.object();
                writer.key("code"); writer.value("ok");
                writer.key("historyEntry"); historyEntry.write(writer, options);
                writer.key("cell"); process.newCell.write(writer, options);
                writer.key("pool"); pool.write(writer, options);
                writer.endObject();
View Full Code Here

           
            JSONWriter writer = new JSONWriter(response.getWriter());

            writer.array();
            for (Column column : project.columnModel.columns) {
                writer.object();
                    write(project, column, writer);
                writer.endObject();
            }
            writer.endArray();
           
View Full Code Here

            response.setHeader("Content-Type", "application/json");
           
            Properties options = new Properties();
            JSONWriter writer = new JSONWriter(response.getWriter());
           
            writer.object();
            writer.key("columnModel"); project.columnModel.write(writer, options);
            writer.key("recordModel"); project.recordModel.write(writer, options);
           
            writer.key("overlayModels"); writer.object();
            for (String modelName : project.overlayModels.keySet()) {
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.