Package org.codehaus.jackson

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


        json.writeStartArray();
        for (Object obj : inputs) {
          List pair = (List) obj;
          json.writeStartArray();
          json.writeString(pair.get(0).toString());
          json.writeString(pair.get(1).toString());
          json.writeEndArray();
        }
        json.writeEndArray();
      }
View Full Code Here


          : "";
      json.writeStringField(EXCEPTION_CLASS, eclass);
      String[] stackTrace = ti.getThrowableStrRep();
      json.writeArrayFieldStart(STACK);
      for (String row : stackTrace) {
        json.writeString(row);
      }
      json.writeEndArray();
    }
    json.writeEndObject();
    json.flush();
View Full Code Here

  @Nonnull
  private static String escape( @Nonnull String value ) {
    try {
      StringWriter out = new StringWriter();
      JsonGenerator generator = new JsonFactory().createJsonGenerator( out );
      generator.writeString( value );
      generator.close();
      return out.toString();
    } catch ( IOException e ) {
      throw new IllegalArgumentException( "Invalid value: <" + value + ">", e );
    }
View Full Code Here

  private static String escape( @Nonnull String value ) {
    try {
      //noinspection TypeMayBeWeakened
      StringWriter out = new StringWriter();
      JsonGenerator generator = new JsonFactory().createJsonGenerator( out );
      generator.writeString( value );
      generator.close();
      return out.toString();
    } catch ( IOException e ) {
      throw new IllegalArgumentException( "Invalid value: <" + value + ">", e );
    }
View Full Code Here

        g.writeRaw("\n    ");
        g.writeArrayFieldStart(key);
        List<String> list = record.getListField(key);
        for (String listValue : list)
        {
          g.writeString(listValue);
        }
        // g.writeEndObject();
        g.writeEndArray();

      }
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.