Package org.json

Examples of org.json.JSONWriter.endObject()


                    writer.key("code");
                    writer.value(s);
                    writer.endObject();
                }
                writer.endArray();
                writer.endObject();
            } catch (Exception e) {
                respondException(response, e);
            }
        }
    }
View Full Code Here


                        writer.object();
                        writer.key("id"); writer.value(tg.id);
                        writer.key("name"); writer.value(tg.name);
                        writer.key("score"); writer.value(tg.score);
                        writer.key("count"); writer.value(tg.count);
                        writer.endObject();
                    }
                   
                    writer.endArray();
                } catch (Exception e) {
                    writer.key("code"); writer.value("error");
View Full Code Here

                } catch (Exception e) {
                    writer.key("code"); writer.value("error");
                }
            }
           
            writer.endObject();
        } catch (Exception e) {
            respondException(response, e);
        }
    }
   
View Full Code Here

                jsonWriter.object();
               
                jsonWriter.key("query"); jsonWriter.value(samples.get(i));
                jsonWriter.key("limit"); jsonWriter.value(3);
               
                jsonWriter.endObject();
            }
            jsonWriter.endObject();
        } catch (JSONException e) {
            // ignore
        }
View Full Code Here

                jsonWriter.key("query"); jsonWriter.value(samples.get(i));
                jsonWriter.key("limit"); jsonWriter.value(3);
               
                jsonWriter.endObject();
            }
            jsonWriter.endObject();
        } catch (JSONException e) {
            // ignore
        }
       
        String queriesString = stringWriter.toString();
View Full Code Here

                for (String s : localExpressions) {
                    writer.object();
                    writer.key("code"); writer.value(s);
                    writer.key("global"); writer.value(false);
                    writer.key("starred"); writer.value(starredExpressions.contains(s));
                    writer.endObject();
                    done.add(s);
                }
                for (String s : globalExpressions) {
                    if (!done.contains(s)) {
                        writer.object();
View Full Code Here

                    if (!done.contains(s)) {
                        writer.object();
                        writer.key("code"); writer.value(s);
                        writer.key("global"); writer.value(true);
                        writer.key("starred"); writer.value(starredExpressions.contains(s));
                        writer.endObject();
                    }
                }
                writer.endArray();
            writer.endObject();
        } catch (Exception e) {
View Full Code Here

                        writer.key("starred"); writer.value(starredExpressions.contains(s));
                        writer.endObject();
                    }
                }
                writer.endArray();
            writer.endObject();
        } catch (Exception e) {
            respondException(response, e);
        }
    }
}
View Full Code Here

                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();
            } else {
                respond(response, "{ \"code\" : \"pending\" }");
            }
        } catch (Exception e) {
            respondException(response, e);
View Full Code Here

                    if (result == null) {
                        writer.value(null);
                    } else if (ExpressionUtils.isError(result)) {
                        writer.object();
                        writer.key("message"); writer.value(((EvalError) result).message);
                        writer.endObject();
                    } else {
                        StringBuffer sb = new StringBuffer();
                       
                        writeValue(sb, result, false);
                       
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.