Package javax.json.stream

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


        generator.writeStartObject(METRICS);
        for (Metric metric : stepExecution.getMetrics()) {
            generator.writeStartObject(METRIC);
            generator.write(METRIC_TYPE, metric.getType().toString());
            generator.write(METRIC_VALUE, metric.getValue());
            generator.writeEnd();
        }
        generator.writeEnd();

        // End main object
        generator.writeEnd();
View Full Code Here


            generator.writeStartObject(METRIC);
            generator.write(METRIC_TYPE, metric.getType().toString());
            generator.write(METRIC_VALUE, metric.getValue());
            generator.writeEnd();
        }
        generator.writeEnd();

        // End main object
        generator.writeEnd();
        generator.close();
        return writer.toString();
View Full Code Here

            generator.writeEnd();
        }
        generator.writeEnd();

        // End main object
        generator.writeEnd();
        generator.close();
        return writer.toString();
    }

    public static StepExecution unmarshall(final String json) throws IOException, ClassNotFoundException {
View Full Code Here

        generator.writeStartObject(PROPERTIES);
        final Properties params = jobExecution.getJobParameters();
        for (String key : params.stringPropertyNames()) {
            generator.write(key, params.getProperty(key));
        }
        generator.writeEnd();

        // End main object
        generator.writeEnd();
        generator.close();
        return writer.toString();
View Full Code Here

            generator.write(key, params.getProperty(key));
        }
        generator.writeEnd();

        // End main object
        generator.writeEnd();
        generator.close();
        return writer.toString();
    }

    public static JobExecution unmarshall(final String json) {
View Full Code Here

    protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("application/json");
        final JsonGenerator generator = Json.createGenerator(response.getWriter());
        generator.writeStartObject();
        generator.write("name", "value");
        generator.writeEnd();
        generator.close();
    }
}
View Full Code Here

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

            final Throwable thrown = record.getThrown();
            if (thrown != null) {
                json.writeStartObject(JSON_KEY_EXCEPTION);
View Full Code Here

            final Throwable thrown = record.getThrown();
            if (thrown != null) {
                json.writeStartObject(JSON_KEY_EXCEPTION);
                boolean withDescription = true;
                writeThrowableToJson(json, thrown, withDescription);
                json.writeEnd();
            }

            final Map<String, String> context = thrown != null ?
                    LoggingContext.getLastEnteredContext() :
                    LoggingContext.getContext();
View Full Code Here

                    LoggingContext.getLastEnteredContext() :
                    LoggingContext.getContext();
            if (context != null) {
                writeContextToJson(json, context);
            }
            json.writeEnd();
        }
        json.flush();
        writer.append('\n');
        return writer.toString();
    }
View Full Code Here

      }
      if (isNotBlank(next.getScheme())) {
        eventWriter.write(Tag.ATTR_SCHEME, next.getScheme());
      }

      eventWriter.writeEnd();
    }
    eventWriter.writeEnd();

    eventWriter.writeEnd();
    eventWriter.flush();
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.