Examples of writeFieldName()


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

                        g.writeFieldName(ksEntry.getKey());
                        g.writeStartArray();
                        for (Map.Entry<String, Map<String, String>> cfEntry : ksEntry.getValue().entrySet())
                        {
                            g.writeStartObject();
                            g.writeFieldName(cfEntry.getKey());
                            g.writeStartArray();
                            for (Map.Entry<String, String> asEntry : cfEntry.getValue().entrySet())
                            {
                                g.writeStartObject();
                                g.writeStringField(asEntry.getKey(), asEntry.getValue());
View Full Code Here

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

            // if no Object users are able to pass a string content
            byte[] bytes = request.getObject() != null
                ? request.getSerializer().serialize( request.getObject() )
                : request.getCacheContent();

            g.writeFieldName( DirectMemoryConstants.CACHE_CONTENT_FIELD_NAME );
            g.writeBinary( bytes );

            if ( serializer != null )
            {
                g.writeStringField( DirectMemoryConstants.SERIALIZER_FIELD_NAME, serializer.getClass().getName() );
View Full Code Here

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

            g.writeStringField( DirectMemoryConstants.KEY_FIELD_NAME, response.getKey() );

            if ( response.getCacheContent() != null && response.getCacheContent().length > 0 )
            {
                g.writeFieldName( DirectMemoryConstants.CACHE_CONTENT_FIELD_NAME );
                g.writeBinary( response.getCacheContent() );
            }

            g.writeEndObject();
            g.close();
View Full Code Here

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

        try {
            final ByteArrayOutputStream out = new ByteArrayOutputStream();
            final JsonGenerator generator = objectMapper.getJsonFactory().createJsonGenerator(out);
            generator.writeStartObject();

            generator.writeFieldName("attribute");
            generator.writeString(attribute);

            generator.writeFieldName("samples");
            generator.writeStartArray();
View Full Code Here

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

            generator.writeStartObject();

            generator.writeFieldName("attribute");
            generator.writeString(attribute);

            generator.writeFieldName("samples");
            generator.writeStartArray();

            if (samples != null) {
                final ConcurrentMap<Object, Object> samplesForType = samples.asMap();
View Full Code Here

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

      Object datum = reader.read(null, binDecoder.get());
      DatumWriter<Object> writer = new GenericDatumWriter<Object>(schema);
      JsonGenerator g = new JsonFactory().createJsonGenerator(out, JsonEncoding.UTF8);
      // write the src ID
      g.writeStartObject();
      g.writeFieldName(SRC_ID_FIELD_NAME);
      g.writeNumber(e.getSourceId());
      g.writeFieldName(OPCODE_FIELD_NAME);
      g.writeString(e.getOpcode().toString());
      g.writeFieldName("partId");
      g.writeNumber(Integer.valueOf(e.getPartitionId()));
View Full Code Here

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

      JsonGenerator g = new JsonFactory().createJsonGenerator(out, JsonEncoding.UTF8);
      // write the src ID
      g.writeStartObject();
      g.writeFieldName(SRC_ID_FIELD_NAME);
      g.writeNumber(e.getSourceId());
      g.writeFieldName(OPCODE_FIELD_NAME);
      g.writeString(e.getOpcode().toString());
      g.writeFieldName("partId");
      g.writeNumber(Integer.valueOf(e.getPartitionId()));

      g.writeFieldName(VALUE_FIELD_NAME);
View Full Code Here

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

      g.writeStartObject();
      g.writeFieldName(SRC_ID_FIELD_NAME);
      g.writeNumber(e.getSourceId());
      g.writeFieldName(OPCODE_FIELD_NAME);
      g.writeString(e.getOpcode().toString());
      g.writeFieldName("partId");
      g.writeNumber(Integer.valueOf(e.getPartitionId()));

      g.writeFieldName(VALUE_FIELD_NAME);
      writer.write(datum, new JsonEncoder(schema, g));
      g.writeEndObject();
View Full Code Here

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

      g.writeFieldName(OPCODE_FIELD_NAME);
      g.writeString(e.getOpcode().toString());
      g.writeFieldName("partId");
      g.writeNumber(Integer.valueOf(e.getPartitionId()));

      g.writeFieldName(VALUE_FIELD_NAME);
      writer.write(datum, new JsonEncoder(schema, g));
      g.writeEndObject();
      g.writeEndObject();
      try {
        g.writeEndObject();
View Full Code Here

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

  public static void dumpConfiguration(Configuration config,
      Writer out) throws IOException {
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
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.