Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonGenerator.writeFieldName()


  public static void dumpConfiguration(Configuration config,
      Writer out) throws IOException {
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
View Full Code Here


    Configuration config = new Configuration(conf,true);
    config.reloadConfiguration();
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
      dumpGenerator.writeStartObject();
      dumpGenerator.writeStringField("key", (String) item.getKey());
View Full Code Here

    generator.writeNumberField( PROPERTY_TOTAL_ROWS, viewResponse.getTotalRows() );
    generator.writeNumberField( PROPERTY_OFFSET, viewResponse.getOffset() );

    //Now the rows
    generator.writeFieldName( PROPERTY_ROWS );
    generator.writeStartArray();


    for ( Row<K, V, ?> row : viewResponse.getRows() ) {
      rowSerializer.serialize( row, keySerializer, valueSerializer, generator );
View Full Code Here

  public static void dumpConfiguration(Configuration config,
      Writer out) throws IOException {
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
View Full Code Here

    try {
      JsonGenerator jsonGenerator = CoronaSerializer.createJsonGenerator(conf);
      jsonGenerator.writeStartObject();

      jsonGenerator.writeFieldName("startTime");
      jsonGenerator.writeNumber(startTime);

      jsonGenerator.writeFieldName("nodeManager");
      nodeManager.write(jsonGenerator);
View Full Code Here

      jsonGenerator.writeStartObject();

      jsonGenerator.writeFieldName("startTime");
      jsonGenerator.writeNumber(startTime);

      jsonGenerator.writeFieldName("nodeManager");
      nodeManager.write(jsonGenerator);

      jsonGenerator.writeFieldName("sessionManager");
      sessionManager.write(jsonGenerator);
View Full Code Here

      jsonGenerator.writeNumber(startTime);

      jsonGenerator.writeFieldName("nodeManager");
      nodeManager.write(jsonGenerator);

      jsonGenerator.writeFieldName("sessionManager");
      sessionManager.write(jsonGenerator);

      jsonGenerator.writeFieldName("sessionNotifier");
      sessionNotifier.write(jsonGenerator);
View Full Code Here

      nodeManager.write(jsonGenerator);

      jsonGenerator.writeFieldName("sessionManager");
      sessionManager.write(jsonGenerator);

      jsonGenerator.writeFieldName("sessionNotifier");
      sessionNotifier.write(jsonGenerator);

      jsonGenerator.writeEndObject();
      jsonGenerator.close();
    } catch (IOException e) {
View Full Code Here

        jGenerator.writeNumberField("listening_port", this.listeningPort);
        jGenerator.writeBooleanField("check_for_updates", false); // NEVER CHECK FOR UPDATES
        jGenerator.writeBooleanField("use_upnp", useUpnp);
        jGenerator.writeStringField("storage_path", this.storagePath);
        jGenerator.writeBooleanField("use_gui", this.useGui);
        jGenerator.writeFieldName("webui");
        jGenerator.writeStartObject(); // {
          jGenerator.writeStringField("listen", this.listen);
          jGenerator.writeStringField("login", this.login);
          jGenerator.writeStringField("password", this.password);
          jGenerator.writeStringField("api_key", this.apiKey);
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.