Examples of writeNumber()


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

      @Override
      public void visit(MetricTreeInteger o) {
        try {
          writeKey(o);
          jsonGenerator.writeNumber(o.getValue());
        } catch (IOException e) {
          throw new IllegalStateException("Error serializing to JSON", e);
        }
      }
View Full Code Here

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

      @Override
      public void visit(MetricTreeFloat o) {
        try {
          writeKey(o);
          jsonGenerator.writeNumber(o.getValue());
        } catch (IOException e) {
          throw new IllegalStateException("Error serializing to JSON", e);
        }
      }
    });
View Full Code Here

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

                continue;
              }
              final long timestamp = data_query.getMsResolution() ?
                  dp.timestamp() : dp.timestamp() / 1000;
              json.writeStartArray();
              json.writeNumber(timestamp);
              if (dp.isInteger()) {
                json.writeNumber(dp.longValue());
              } else {
                json.writeNumber(dp.doubleValue());
              }
View Full Code Here

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

              final long timestamp = data_query.getMsResolution() ?
                  dp.timestamp() : dp.timestamp() / 1000;
              json.writeStartArray();
              json.writeNumber(timestamp);
              if (dp.isInteger()) {
                json.writeNumber(dp.longValue());
              } else {
                json.writeNumber(dp.doubleValue());
              }
              json.writeEndArray();
            }
View Full Code Here

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

              json.writeStartArray();
              json.writeNumber(timestamp);
              if (dp.isInteger()) {
                json.writeNumber(dp.longValue());
              } else {
                json.writeNumber(dp.doubleValue());
              }
              json.writeEndArray();
            }
            json.writeEndArray();
          } else {
View Full Code Here

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

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

        // and finally as scalar
        buf = new TokenBuffer(mapper, false);
        buf.writeNumber(321);
        json = mapper.writeValueAsString(new ObjectHolder(buf));
        holder = mapper.readValue(json, ObjectHolder.class);
        assertNotNull(holder.value);
        assertSame(TokenBuffer.class, holder.value.getClass());
        jp = ((TokenBuffer) holder.value).asParser();
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.writeNumber()

        gen.setNextName(new QName("root"));
        gen.writeStartObject();
        // and also need to force attribute
        gen.writeFieldName("attr");
        gen.setNextIsAttribute(true);
        gen.writeNumber(-3);

        // Also let's add child element as well
        gen.setNextIsAttribute(false);
        gen.writeFieldName("elem");
        gen.writeNumber(13);
View Full Code Here

Examples of com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.writeNumber()

        gen.writeNumber(-3);

        // Also let's add child element as well
        gen.setNextIsAttribute(false);
        gen.writeFieldName("elem");
        gen.writeNumber(13);
        gen.writeEndObject();
        gen.close();
        String xml = removeSjsxpNamespace(out.toString());
        assertEquals("<root attr=\"-3\"><elem>13</elem></root>", xml);
    }
View Full Code Here

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

            {
                g.writeStartObject();
                g.writeNumberField("generation", level);
                g.writeArrayFieldStart("members");
                for (SSTableReader ssTableReader : generations[level])
                    g.writeNumber(ssTableReader.descriptor.generation);
                g.writeEndArray(); // members

                g.writeEndObject(); // generation
            }
            g.writeEndArray(); // for field generations
View Full Code Here

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

        generator.writeFieldName("bool");
        generator.writeBoolean(true);
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
        generator.writeFieldName("gg");
        generator.writeStartObject();
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeEndObject();
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.