Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.JsonGenerator.writeEndArray()


      public void visit(MetricTreeArray o) {
        try {
          writeKey(o);
          jsonGenerator.writeStartArray();
          o.visitItems(this);
          jsonGenerator.writeEndArray();
        } catch (IOException e) {
          throw new IllegalStateException("Error serializing to JSON", e);
        }
      }
View Full Code Here


            gen.writeStringField( "jql", jqlQuery );
            gen.writeNumberField( "maxResults", nbEntriesMax );
            gen.writeArrayFieldStart( "fields" );
            // Retrieve all fields. If that seems slow, we can reconsider.
            gen.writeString( "*all" );
            gen.writeEndArray();
            gen.writeEndObject();
            gen.close();
            client.replacePath( "/rest/api/2/search" );
            client.type( MediaType.APPLICATION_JSON_TYPE );
            client.accept( MediaType.APPLICATION_JSON_TYPE );
View Full Code Here

            gen.writeStringField( "jql", jqlQuery );
            gen.writeNumberField( "maxResults", nbEntriesMax );
            gen.writeArrayFieldStart( "fields" );
            // Retrieve all fields. If that seems slow, we can reconsider.
            gen.writeString( "*all" );
            gen.writeEndArray();
            gen.writeEndObject();
            gen.close();
            client.replacePath( "/rest/api/2/search" );
            client.type( MediaType.APPLICATION_JSON_TYPE );
            client.accept( MediaType.APPLICATION_JSON_TYPE );
View Full Code Here

            jg.writeFieldName("query");
            jg.writeStartArray();

            writePhases(jg);

            jg.writeEndArray();
            if (timeout != null) {
                jg.writeNumberField("timeout", timeout);
            }

            jg.writeEndObject();
View Full Code Here

          boolean isEditable=(Boolean)(en.getMethod("isEditable")).invoke(v);
          String valueDescription=(String) (en.getMethod("getValueDescription")).invoke(v);
          Class type = (Class) en.getMethod("getType").invoke(v);
            String subsection = key.substring(0, key.indexOf('.'));
            if (!lastSection.equals(subsection)) {
            if (gen.getOutputContext().inArray()) gen.writeEndArray();
              gen.writeFieldName(subsection);                                    //      "sectionName":
              gen.writeStartArray();                                        //        [
              lastSection = subsection;
           
            boolean isOverridden = (Boolean)(en.getMethod("isOverridden")).invoke(v);
View Full Code Here

            gen.writeBooleanField("editable",isEditable);                          //            ,"editable":"true|false"
            gen.writeBooleanField("visible",isVisible);                          //            ,"visible":"true|false"
            gen.writeBooleanField("overridden",isOverridden);                          //            ,"overridden":"true|false"
            gen.writeEndObject();                                          //          }
      }
      if (gen.getOutputContext().inArray()) gen.writeEndArray();                          //        ]
      gen.writeEndObject();                                            //    }
      gen.writeEndObject();                                          //}
      gen.close();
      return sw.toString();
    } catch (Exception e) {
View Full Code Here

        Logger.debug("OBJECT:" + p.toString());
        Logger.debug("STRING:" + st);
        //JsonParser jp = jfactory.createJsonParser(st);
        gen.writeTree(p);
      }
      gen.writeEndArray();
      gen.close();
      return sw.toString();
    }catch (Exception e) {
      Logger.error("Cannot generate a json for the configuration",e);
    }
View Full Code Here

            gen.writeStringField("type",type.getSimpleName());                          //            ,"type":"type"
            gen.writeBooleanField("editable", isEditable);
            gen.writeBooleanField("overridden", isOverridden);
            gen.writeEndObject();                                          //          }
      }
      if (gen.getOutputContext().inArray()) gen.writeEndArray();                          //        ]
      gen.close();
      return sw.toString();
    } catch (Exception e) {
      Logger.error("Cannot generate a json for "+ en.getSimpleName()+" Enum. Is it an Enum that implements the IProperties interface?",e);
    }
View Full Code Here

          if (dps.getAggregatedTags() != null) {
            for (String atag : dps.getAggregatedTags()) {
              json.writeString(atag);
            }
          }
          json.writeEndArray();
         
          if (data_query.getShowTSUIDs()) {
            json.writeFieldName("tsuids");
            json.writeStartArray();
            final List<String> tsuids = dps.getTSUIDs();
View Full Code Here

            final List<String> tsuids = dps.getTSUIDs();
            Collections.sort(tsuids);
            for (String tsuid : tsuids) {
              json.writeString(tsuid);
            }
            json.writeEndArray();
          }
         
          if (!data_query.getNoAnnotations()) {
            final List<Annotation> annotations = dps.getAnnotations();
            if (annotations != null) {
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.