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

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

Introduction

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

Prototype

public abstract void writeEndArray() throws IOException, JsonGenerationException;

Source Link

Document

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

Usage

From source file:xyz.cloudbans.entities.jackson.serializer.ServerIdsSerializer.java

@Override
public void serialize(Collection<Server> servers, JsonGenerator jsonGenerator,
        SerializerProvider serializerProvider) throws IOException {
    jsonGenerator.writeStartArray();/*  ww w. jav  a2  s.  c o  m*/
    for (Server server : servers)
        jsonGenerator.writeString(server.getId().toString());
    jsonGenerator.writeEndArray();
}

From source file:de.dfki.asr.compass.rest.serialization.EntityListToIDListSerializer.java

@Override
public void serialize(final List<? extends AbstractCompassEntity> list, final JsonGenerator jgen,
        final SerializerProvider provider) throws IOException, JsonProcessingException {
    jgen.writeStartArray();/* w  ww  .  j  a  va  2s.  c om*/
    for (AbstractCompassEntity entity : list) {
        jgen.writeNumber(entity.getId());
    }
    jgen.writeEndArray();
}

From source file:com.basistech.rosette.dm.jackson.array.ListAttributeArraySerializer.java

private void writeItems(ListAttribute value, JsonGenerator jgen, SerializerProvider provider)
        throws IOException {
    jgen.writeStartArray();//w ww  .  j a v a2 s .  c o  m

    for (Object attr : value) {
        provider.defaultSerializeValue(attr, jgen);
    }

    jgen.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_int(JsonGenerator jg, int[] array) throws IOException {
    jg.writeStartArray();//from  w  w w  .jav a  2  s .c om
    for (int val : array) {
        jg.writeNumber(val);
    }
    jg.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_char(JsonGenerator jg, char[] array) throws IOException {
    jg.writeStartArray();//from  w w w.j  av  a  2  s. c om
    for (char val : array) {
        jg.writeObject(val);
    }
    jg.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_byte(JsonGenerator jg, byte[] array) throws IOException {
    jg.writeStartArray();//from  w  ww  .  j  a  v  a  2 s  .  com
    for (byte val : array) {
        jg.writeNumber(val);
    }
    jg.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_float(JsonGenerator jg, float[] array) throws IOException {
    jg.writeStartArray();// ww w .  j a va  2  s .  co m
    for (float val : array) {
        jg.writeNumber(val);
    }
    jg.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_short(JsonGenerator jg, short[] array) throws IOException {
    jg.writeStartArray();/* w  w  w .  j  ava2s .  c  o  m*/
    for (short val : array) {
        jg.writeNumber(val);
    }
    jg.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_String(JsonGenerator jg, String[] array) throws IOException {
    jg.writeStartArray();//w ww. j  a va  2  s  . com
    for (String val : array) {
        jg.writeObject(val);
    }
    jg.writeEndArray();
}

From source file:org.example.testcases.BasicTypeArraysSerializer.java

private void writeArray_double(JsonGenerator jg, double[] array) throws IOException {
    jg.writeStartArray();//from   w ww  .  j  a v a 2  s  . c  o m
    for (double val : array) {
        jg.writeNumber(val);
    }
    jg.writeEndArray();
}