APISonar


com.sonyericsson.chkbugreport.webserver.JSON.JSON

> com > sonyericsson > chkbugreport > webserver > JSON > JSON
com APIs sonyericsson APIs chkbugreport APIs webserver APIs JSON APIs JSON APIs

Example 1
public void deleteComment(Module mod, HTTPRequest req, HTTPResponse resp) {
        JSON json = new JSON();
        int commentId = extractCommentId(req.getArg("id"));
        Comment c = findById(commentId);
        if (c == null) {
            json.add("err", 400);
            json.add("msg", "Cannot find comment to delete!");
        } else {
            delete(c);
            json.add("err", 200);
            json.add("msg", "Comment deleted!");
        }
        json.writeTo(resp);
    }
Example 2
public void listFilterGroups(Module mod, HTTPRequest req, HTTPResponse resp) {
        JSON json = new JSON();
        JSON filters = json.addArray("filters");
        for (FilterGroup fg : getData()) {
            filters.add(fg.getName());
        }
        json.writeTo(resp);
    }