Example usage for com.fasterxml.jackson.core JsonGenerator writeEndObject

List of usage examples for com.fasterxml.jackson.core JsonGenerator writeEndObject

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonGenerator writeEndObject.

Prototype

public abstract void writeEndObject() throws IOException, JsonGenerationException;

Source Link

Document

Method for writing closing marker of a JSON Object value (character '}'; plus possible white space decoration if pretty-printing is enabled).

Usage

From source file:org.opendaylight.ovsdb.lib.notation.json.RowSerializer.java

@Override
public void serialize(Row row, JsonGenerator generator, SerializerProvider provider)
        throws IOException, JsonProcessingException {
    generator.writeStartObject();//w  w w.  j  av  a  2  s .co m
    Collection<Column> columns = row.getColumns();
    for (Column<?, ?> column : columns) {
        generator.writeObjectField(column.getSchema().getName(), column.getData());
    }
    generator.writeEndObject();
}

From source file:com.strategicgains.hyperexpress.serialization.siren.jackson.SirenResourceSerializer.java

@Override
public void serialize(SirenResource resource, JsonGenerator jgen, SerializerProvider provider)
        throws IOException, JsonProcessingException {
    jgen.writeStartObject();/*ww  w  .  j av a 2 s . c  o m*/
    renderJson(resource, jgen);
    jgen.writeEndObject();
}

From source file:com.strategicgains.hyperexpress.serialization.siren.jackson.SirenResourceSerializer.java

private void writeTitle(String title, JsonGenerator jgen) throws IOException {
    if (title != null && !title.isEmpty()) {
        jgen.writeObjectFieldStart(TITLE);
        jgen.writeObject(title);/*w ww. java  2 s .  com*/
        jgen.writeEndObject();
    }
}

From source file:com.github.fge.jsonpatch.PathValueOperation.java

@Override
public final void serialize(final JsonGenerator jgen, final SerializerProvider provider)
        throws IOException, JsonProcessingException {
    jgen.writeStartObject();//from   ww w .j  a v  a 2s .c o  m
    jgen.writeStringField("op", op);
    jgen.writeStringField("path", path.toString());
    jgen.writeFieldName("value");
    jgen.writeTree(value);
    jgen.writeEndObject();
}

From source file:org.emfjson.jackson.databind.ser.EMapStringSerializer.java

@Override
public void serialize(EList<Map.Entry<String, ?>> value, JsonGenerator jg, SerializerProvider serializers)
        throws IOException {
    if (value == null || value.isEmpty()) {
        jg.writeNull();//from   w  w  w. j a  v a 2s .com
        return;
    }

    jg.writeStartObject();
    for (Map.Entry<String, ?> entry : value) {
        jg.writeObjectField(entry.getKey(), entry.getValue());
    }
    jg.writeEndObject();
}

From source file:org.hawkular.alerts.rest.json.LinkSerializer.java

@Override
public void serialize(Link link, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
        throws IOException {

    jsonGenerator.writeStartObject();/* www.ja v a2s.  c  om*/
    jsonGenerator.writeFieldName(link.getRel());

    jsonGenerator.writeStartObject();
    jsonGenerator.writeFieldName("href");
    jsonGenerator.writeString(link.getHref());
    jsonGenerator.writeEndObject();

    jsonGenerator.writeEndObject();
}

From source file:org.n52.io.geojson.FeatureOutputSerializer.java

private void writeFeature(GeoJSONFeature value, JsonGenerator gen) throws IOException {
    gen.writeStartObject();//from   ww w  .ja  v a  2  s .c  o  m
    gen.writeStringField("type", "Feature");
    gen.writeStringField("id", value.getId());
    gen.writeObjectField("properties", value.getProperties());
    gen.writeObjectField("geometry", encodeGeometry(value));
    gen.writeEndObject();
}

From source file:piazza.services.ingest.util.GeoJsonSerializer.java

private void writePoint(JsonGenerator jgen, Point p) throws IOException {
    jgen.writeStartObject();/* w  w w.  j av  a 2 s  .  c om*/
    jgen.writeStringField("type", "Point");
    jgen.writeFieldName("coordinates");
    writePointCoords(jgen, p);
    jgen.writeEndObject();
}

From source file:com.sdl.odata.renderer.json.writer.JsonServiceDocumentWriter.java

/**
 * Build an embedded json object that will have key-value attributes like
 * 'name' and 'url' (they are MUST), 'title' and 'kind'.
 *
 * @param jsonGenerator jsonGenerator/*ww  w .j a va  2s .  c  om*/
 * @param entity        entitySet or singleton
 * @throws IOException
 */
private void writeObject(JsonGenerator jsonGenerator, Object entity) throws IOException {
    jsonGenerator.writeStartObject();

    writeName(jsonGenerator, entity);
    writeKind(jsonGenerator, entity);
    writeURL(jsonGenerator, entity);

    jsonGenerator.writeEndObject();
}

From source file:org.echocat.marquardt.common.serialization.PublicKeySerializer.java

@Override
public void serialize(final PublicKey publicKey, final JsonGenerator jsonGenerator,
        final com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException {
    final PublicKeyWithMechanism publicKeyWithMechanism = new PublicKeyWithMechanism(publicKey);
    jsonGenerator.writeStartObject();/*  w  w w.  j  av  a 2s  . co  m*/
    jsonGenerator.writeBinaryField(KEY, publicKeyWithMechanism.getContent());
    jsonGenerator.writeEndObject();
}