Package org.codehaus.jackson

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


    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        dumpGenerator.writeStringField("resource",
                                       config.updatingResource.get(item.getKey()));
View Full Code Here


        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        dumpGenerator.writeStringField("resource",
                                       config.updatingResource.get(item.getKey()));
        dumpGenerator.writeEndObject();
      }
    }
    dumpGenerator.writeEndArray();
View Full Code Here

        ByteArrayOutputStream bytes = new ByteArrayOutputStream(100);
       
        JsonGenerator jgen = sf.createJsonGenerator(bytes);
        jgen.writeStartArray();
        jgen.writeStartObject();
        jgen.writeStringField("key", "value");
        jgen.writeEndObject();
        jgen.writeStartObject();
        jgen.writeStringField("key", "value");
        jgen.writeEndObject();
        jgen.writeEndArray();
View Full Code Here

        jgen.writeStartArray();
        jgen.writeStartObject();
        jgen.writeStringField("key", "value");
        jgen.writeEndObject();
        jgen.writeStartObject();
        jgen.writeStringField("key", "value");
        jgen.writeEndObject();
        jgen.writeEndArray();
        jgen.close();

        SmileParser p = _smileParser(bytes.toByteArray());
View Full Code Here

  public String createJson() throws IOException {
    StringWriter writer = new StringWriter();
    JsonGenerator generator = new JsonFactory().createJsonGenerator( writer );
    generator.writeStartObject();

    generator.writeStringField( "_id", id );
    generator.writeStringField( "language", "javascript" );

    generator.writeObjectFieldStart( "views" );

    for ( DesignDocuments.View view : views ) {
View Full Code Here

    StringWriter writer = new StringWriter();
    JsonGenerator generator = new JsonFactory().createJsonGenerator( writer );
    generator.writeStartObject();

    generator.writeStringField( "_id", id );
    generator.writeStringField( "language", "javascript" );

    generator.writeObjectFieldStart( "views" );

    for ( DesignDocuments.View view : views ) {
      generator.writeObjectFieldStart( view.getName() );
View Full Code Here

    generator.writeObjectFieldStart( "views" );

    for ( DesignDocuments.View view : views ) {
      generator.writeObjectFieldStart( view.getName() );

      generator.writeStringField( "map", view.getMappingFunction() );
      @Nullable String reduceFunction = view.getReduceFunction();
      if ( reduceFunction != null ) {
        generator.writeStringField( "reduce", reduceFunction );
      }
      generator.writeEndObject();
View Full Code Here

      generator.writeObjectFieldStart( view.getName() );

      generator.writeStringField( "map", view.getMappingFunction() );
      @Nullable String reduceFunction = view.getReduceFunction();
      if ( reduceFunction != null ) {
        generator.writeStringField( "reduce", reduceFunction );
      }
      generator.writeEndObject();
    }

View Full Code Here

    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        String[] resources = config.updatingResource.get(item.getKey());
View Full Code Here

    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
        dumpGenerator.writeStringField("key", (String) item.getKey());
        dumpGenerator.writeStringField("value",
                                       config.get((String) item.getKey()));
        dumpGenerator.writeBooleanField("isFinal",
                                        config.finalParameters.contains(item.getKey()));
        String[] resources = config.updatingResource.get(item.getKey());
        String resource = UNKNOWN_RESOURCE;
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.