Examples of writeStartArray()


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

      @Override
      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

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

            jg.writeFieldName("inputs");
            writeInput(jg);

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

            writePhases(jg);

            jg.writeEndArray();
            if (timeout != null) {
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.TokenBuffer.writeStartArray()

    {
        /* Ok: time to mix type id, value; and we will actually use "wrapper-array"
         * style to ensure we can handle all kinds of JSON constructs.
         */
        TokenBuffer merged = new TokenBuffer(jp.getCodec());
        merged.writeStartArray();
        merged.writeString(_typeIds[index]);
        JsonParser p2 = _tokens[index].asParser(jp);
        p2.nextToken();
        merged.copyCurrentStructure(p2);
        merged.writeEndArray();
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.TokenBuffer.writeStartArray()

        jp.close();
        buf.close();

        // then as an array:
        buf = new TokenBuffer(mapper, false);
        buf.writeStartArray();
        buf.writeBoolean(true);
        buf.writeEndArray();
        json = mapper.writeValueAsString(new ObjectHolder(buf));
        holder = mapper.readValue(json, ObjectHolder.class);
        assertNotNull(holder.value);
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.TokenBuffer.writeStartArray()

    @SuppressWarnings("resource")
    protected final Object _deserialize(JsonParser jp, DeserializationContext ctxt,
            int index, String typeId) throws IOException
    {
        TokenBuffer merged = new TokenBuffer(jp);
        merged.writeStartArray();
        merged.writeString(typeId);
        JsonParser p2 = _tokens[index].asParser(jp);
        p2.nextToken();
        merged.copyCurrentStructure(p2);
        merged.writeEndArray();
View Full Code Here

Examples of com.fasterxml.jackson.databind.util.TokenBuffer.writeStartArray()

    {
        /* Ok: time to mix type id, value; and we will actually use "wrapper-array"
         * style to ensure we can handle all kinds of JSON constructs.
         */
        TokenBuffer merged = new TokenBuffer(jp);
        merged.writeStartArray();
        merged.writeString(typeId);
        JsonParser p2 = _tokens[index].asParser(jp);
        p2.nextToken();
        merged.copyCurrentStructure(p2);
        merged.writeEndArray();
View Full Code Here

Examples of com.linkedin.data.schema.JsonBuilder.writeStartArray()

    JsonBuilder jsonBuilder = new JsonBuilder(JsonBuilder.Pretty.INDENTED);
    SchemaToJsonEncoder encoder = new SchemaToJsonEncoder(jsonBuilder);

    jsonBuilder.writeStartObject();
    jsonBuilder.writeFieldName(Snapshot.MODELS_KEY);
    jsonBuilder.writeStartArray();

    List<NamedDataSchema> models = generateModelList();

    for(DataSchema model : models){
      encoder.encode(model);
View Full Code Here

Examples of de.odysseus.staxon.json.JsonXMLStreamWriter.writeStartArray()

  public void testArray() throws Exception {
    StringWriter result = new StringWriter();
    JsonXMLStreamWriter writer = createXmlStreamWriter(result, new QName("alice"));
    writer.writeStartDocument();
    writer.writeStartElement("alice");
    writer.writeStartArray("bob");
    writer.writeStartElement("bob");
    writer.writeCharacters("charlie");
    writer.writeEndElement();
    writer.writeStartElement("bob");
    writer.writeCharacters("david");
View Full Code Here

Examples of javax.json.stream.JsonGenerator.writeStartArray()

            if (null != record.getSourceMethodName()) {
                json.write(JSON_KEY_SOURCE_METHOD, record.getSourceMethodName());
            }

            if (!tags.isEmpty()) {
                json.writeStartArray("tags");
                for (String tag: tags) {
                    json.write(tag);
                }
                json.writeEnd();
            }
View Full Code Here

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

          writer.append(JacksonUtil.toJson(retValue));
        } else {
          JsonGenerator g = JacksonUtil.getMapper().getJsonFactory().createJsonGenerator(writer);
          g.writeStartObject();
          g.writeFieldName("__cmds");
          g.writeStartArray();
          List<Object> functions = new ArrayList<Object>(context.getFunctions());
          for (Object function : functions) {
            g.writeObject(function);
          }
          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.