Search in sources :

Example 1 with PointValueTimeJsonWriter

use of com.infiniteautomation.mango.rest.v2.model.pointValue.PointValueTimeJsonWriter in project ma-modules-public by infiniteautomation.

the class PointValueTimeStreamJsonSerializer method serialize.

/* (non-Javadoc)
     * @see com.fasterxml.jackson.databind.JsonSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
     */
@Override
public void serialize(PointValueTimeStream<T, INFO> value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
    PointValueTimeWriter writer = new PointValueTimeJsonWriter(value.getQueryInfo(), jgen);
    value.setContentType(StreamContentType.JSON);
    value.start(writer);
    value.streamData(writer);
    value.finish(writer);
    jgen.flush();
}
Also used : PointValueTimeWriter(com.infiniteautomation.mango.rest.v2.model.pointValue.PointValueTimeWriter) PointValueTimeJsonWriter(com.infiniteautomation.mango.rest.v2.model.pointValue.PointValueTimeJsonWriter)

Aggregations

PointValueTimeJsonWriter (com.infiniteautomation.mango.rest.v2.model.pointValue.PointValueTimeJsonWriter)1 PointValueTimeWriter (com.infiniteautomation.mango.rest.v2.model.pointValue.PointValueTimeWriter)1