Package com.fasterxml.jackson.core

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


        builder.append("\n");
      }
    }
    backtrace = builder.toString();

    generator.writeStartObject();
    generator.writeStringField("project", this.project);
    generator.writeStringField("environment", this.environment);
    generator.writeStringField("serverName", this.serverName);
    generator.writeStringField("backtrace", backtrace);
    generator.writeStringField("message", message);
View Full Code Here


    while (this.passthroughExceptions.contains(rootThrowable.getClassName())
        && rootThrowable.getCause() != null) {
      rootThrowable = rootThrowable.getCause();
    }

    generator.writeStartObject();
    generator.writeStringField("project", this.project);
    generator.writeStringField("environment", this.environment);
    generator.writeStringField("serverName", this.serverName);
    // FIXME this was 'throwable'
    generator.writeStringField("backtrace", getStackTrace(rootThrowable));
View Full Code Here

    while (this.passthroughExceptions.contains(rootThrowable.getClass())
        && rootThrowable.getCause() != null) {
      rootThrowable = rootThrowable.getCause();
    }

    generator.writeStartObject();
    generator.writeStringField("project", this.project);
    generator.writeStringField("environment", this.environment);
    generator.writeStringField("serverName", this.serverName);
    generator.writeStringField("backtrace",
        ExceptionUtils.getStackTrace(throwable));
View Full Code Here

        try
        {
            JsonGenerator g = this.jsonFactory.createJsonGenerator( stringWriter );

            g.writeStartObject();

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

            g.writeBooleanField( DirectMemoryConstants.PUT_FIELD_NAME, request.isUpdate() );
View Full Code Here

        try
        {

            JsonGenerator g = this.jsonFactory.createJsonGenerator( stringWriter );

            g.writeStartObject();

            g.writeBooleanField( DirectMemoryConstants.FOUND_FIELD_NAME, response.isFound() );

            g.writeStringField( DirectMemoryConstants.KEY_FIELD_NAME, response.getKey() );
View Full Code Here

            // nothing there, lets create it
            if (isTemplateMissing) {
                LOGGER.debug("No metrics template found in elasticsearch. Adding...");
                HttpURLConnection putTemplateConnection = openConnection( "/_template/metrics_template", "PUT");
                JsonGenerator json = new JsonFactory().createGenerator(putTemplateConnection.getOutputStream());
                json.writeStartObject();
                json.writeStringField("template", index + "*");
                json.writeObjectFieldStart("mappings");

                json.writeObjectFieldStart("_default_");
                json.writeObjectFieldStart("_all");
View Full Code Here

    public void write(ReadableRepresentation representation, Set<URI> flags, Writer writer) {

        try {
            JsonGenerator g = getJsonGenerator(flags, writer);
            g.writeStartObject();
            renderJson(flags, g, representation, false);
            g.writeEndObject();
            g.close();
        } catch (IOException e) {
            throw new RepresentationException(e);
View Full Code Here

    // TODO - precalc how much memory to grab
    final ByteArrayOutputStream output = new ByteArrayOutputStream();
    try {
      final JsonGenerator json = JSON.getFactory().createGenerator(output);
     
      json.writeStartObject();
     
      // we only need to write a small amount of information
      //json.writeNumberField("treeId", tree_id);
      json.writeStringField("name", name);
      json.writeStringField("description", description);
View Full Code Here

    final ByteArrayOutputStream output = new ByteArrayOutputStream(
        (display_name.length() * 2) + (path.size() * 128));
    try {
      final JsonGenerator json = JSON.getFactory().createGenerator(output);
     
      json.writeStartObject();
     
      // we only need to write a small amount of information
      json.writeObjectField("path", path);
      json.writeStringField("displayName", display_name);
     
View Full Code Here

  private byte[] getStorageJSON() {
    // TODO - precalculate size
    final ByteArrayOutputStream output = new ByteArrayOutputStream();
    try {
      final JsonGenerator json = JSON.getFactory().createGenerator(output);
      json.writeStartObject();
      if (tsuid != null && !tsuid.isEmpty()) {
        json.writeStringField("tsuid", tsuid)
      }
      json.writeNumberField("startTime", start_time);
      json.writeNumberField("endTime", end_time);
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.