Package org.json

Examples of org.json.JSONWriter.object()


       
        if (!"true".equals(options.getProperty("preview"))) {
            StringWriter stringWriter = new StringWriter();
            JSONWriter jsonWriter = new JSONWriter(stringWriter);
            try {
                jsonWriter.object();
                jsonWriter.key("template"); jsonWriter.value(templateString);
                jsonWriter.key("prefix"); jsonWriter.value(prefixString);
                jsonWriter.key("suffix"); jsonWriter.value(suffixString);
                jsonWriter.key("separator"); jsonWriter.value(separatorString);
                jsonWriter.endObject();
View Full Code Here


            response.setHeader("Content-Type", "application/json");
           
            Properties options = new Properties();
            JSONWriter writer = new JSONWriter(response.getWriter());
           
            writer.object();
            writer.key("entries"); writer.array();
           
            for (HistoryEntry entry : project.history.getLastPastEntries(-1)) {
                writer.object();
                writer.key("description"); writer.value(entry.description);
View Full Code Here

           
            writer.object();
            writer.key("entries"); writer.array();
           
            for (HistoryEntry entry : project.history.getLastPastEntries(-1)) {
                writer.object();
                writer.key("description"); writer.value(entry.description);
                if (entry.operation != null) {
                    writer.key("operation");
                    entry.operation.write(writer, options);
                }
View Full Code Here

                writer.write(callback);
                writer.write("(");
            }
           
            JSONWriter jsonWriter = new JSONWriter(writer);
            jsonWriter.object();
           
            RowWritingVisitor rwv = new RowWritingVisitor(start, limit, jsonWriter, options);
           
            JSONObject sortingJson = null;
            try{
View Full Code Here

            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            JSONWriter writer = new JSONWriter(response.getWriter());
           
            writer.object();
            writer.key("value");
            if (pref == null || pref instanceof String || pref instanceof Number || pref instanceof Boolean) {
                writer.value(pref);
            } else if (pref instanceof TopList) {
                TopList tl = (TopList) pref;
View Full Code Here

           
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            JSONWriter writer = new JSONWriter(response.getWriter());
            writer.object();
            writer.key("expressions");
                writer.array();
                for (String s : starredExpressions) {
                    writer.object();
                    writer.key("code"); writer.value(s);
View Full Code Here

            JSONWriter writer = new JSONWriter(response.getWriter());
            writer.object();
            writer.key("expressions");
                writer.array();
                for (String s : starredExpressions) {
                    writer.object();
                    writer.key("code"); writer.value(s);
                    writer.endObject();
                }
                writer.endArray();
            writer.endObject();
View Full Code Here

            response.setHeader("Content-Type", "application/json");
           
            JSONWriter writer = new JSONWriter(response.getWriter());
            Properties options = new Properties();
           
            writer.object();
            writer.key("projects");
                writer.object();
                Map<Long, ProjectMetadata> m = ProjectManager.singleton.getAllProjectMetadata();
                for (Entry<Long,ProjectMetadata> e : m.entrySet()) {
                    ProjectMetadata pm = e.getValue();
View Full Code Here

            JSONWriter writer = new JSONWriter(response.getWriter());
            Properties options = new Properties();
           
            writer.object();
            writer.key("projects");
                writer.object();
                Map<Long, ProjectMetadata> m = ProjectManager.singleton.getAllProjectMetadata();
                for (Entry<Long,ProjectMetadata> e : m.entrySet()) {
                    ProjectMetadata pm = e.getValue();
                    if (pm != null) {
                        writer.key(e.getKey().toString());
View Full Code Here

            try {
                response.setCharacterEncoding("UTF-8");
                response.setHeader("Content-Type", "application/json");

                JSONWriter writer = new JSONWriter(response.getWriter());
                writer.object();
                writer.key("expressions");
                writer.array();
                for (String s : starredExpressions) {
                    writer.object();
                    writer.key("code");
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.