Examples of endObject()


Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

                final Object value = props.get(key);
                if(value != null) {
                    w.key(key.toString()).value(value.toString());
                }
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
    }
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

                if(value != null) {
                    w.key(key.toString()).value(value.toString());
                }
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
    }
}
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

            w.key("descriptors");
            w.object();
            for(String key : repository.getDescriptorKeys()) {
                w.key(key).value(repository.getDescriptor(key));
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
        response.getWriter().flush();
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

            w.object();
            for(String key : repository.getDescriptorKeys()) {
                w.key(key).value(repository.getDescriptor(key));
            }
            w.endObject();
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
        response.getWriter().flush();
    }
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

            w.setTidy(true);
            w.object();
            for(Map.Entry<String, AtomicInteger> entry : counters.entrySet()) {
                w.key(entry.getKey()).value(entry.getValue());
            }
            w.endObject();
        } catch(JSONException je) {
            throw (IOException)new IOException("JSONException in doGet").initCause(je);
        }
    }
}
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

                    writer.array();
                    for (Item item : list.getItems()) {
                        writer.object();
                        writer.key("text").value(item.getTitle());
                        writer.key("value").value(item.getValue());
                        writer.endObject();
                    }
                    writer.endArray();
                    writer.endObject();
                    return (AdapterType) new ByteArrayInputStream(buffer.toString().getBytes("UTF-8"));
                } catch (Exception e) {
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

                        writer.key("text").value(item.getTitle());
                        writer.key("value").value(item.getValue());
                        writer.endObject();
                    }
                    writer.endArray();
                    writer.endObject();
                    return (AdapterType) new ByteArrayInputStream(buffer.toString().getBytes("UTF-8"));
                } catch (Exception e) {
                    log.warn("Unable to generate JSON object.", e);
                    return null;
                }
View Full Code Here

Examples of org.apache.sling.commons.json.io.JSONWriter.endObject()

                writer.object();
                for (final FlushResult result : overallResults) {
                    writer.key(result.agentId);
                    writer.value(result.success);
                }
                writer.endObject();
            } catch (JSONException e) {
                throw new ServletException("Unable to output JSON data", e);
            }
        } else {
            String suffix;
View Full Code Here

Examples of org.apache.wicket.ajax.json.JSONStringer.endObject()

        writer.key("ajax");
        ajax.toJson(writer);
      }
      Json.writeFunction(writer, "data", data);
      Json.writeFunction(writer, "tags", tags);
      writer.endObject();

      return writer.toString();
    } catch (JSONException e) {
      throw new RuntimeException("Could not convert Select2 settings object to Json", e);
    }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JSONWriter.endObject()

      json.object();
      json.key("results").array();
      for (T item : response) {
        json.object();
        provider.toJson(item, json);
        json.endObject();
      }
      json.endArray();
      json.key("more").value(response.getHasMore()).endObject();
    } catch (JSONException e) {
      throw new RuntimeException("Could not write Json response", e);
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.