Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package io.prestosql.jdbc.$internal.jackson.databind.ser.impl;
import java.io.IOException;
import java.util.Set;
import io.prestosql.jdbc.$internal.jackson.core.JsonGenerator;
import io.prestosql.jdbc.$internal.jackson.core.JsonToken;
import io.prestosql.jdbc.$internal.jackson.core.type.WritableTypeId;
import io.prestosql.jdbc.$internal.jackson.databind.*;
import io.prestosql.jdbc.$internal.jackson.databind.jsontype.TypeSerializer;
import io.prestosql.jdbc.$internal.jackson.databind.ser.BeanPropertyWriter;
import io.prestosql.jdbc.$internal.jackson.databind.ser.std.BeanSerializerBase;
import io.prestosql.jdbc.$internal.jackson.databind.util.NameTransformer;
/**
* Specialized POJO serializer that differs from
* {@link io.prestosql.jdbc.$internal.jackson.databind.ser.BeanSerializer}
* in that instead of producing a JSON Object it will output
* a JSON Array, omitting field names, and serializing values in
* specified serialization order.
* This behavior is usually triggered by using annotation
* {@link io.prestosql.jdbc.$internal.jackson.annotation.JsonFormat} or its
* equivalents.
*
* This serializer can be used for "simple" instances; and will NOT
* be used if one of following is true:
*
*
Unwrapping is used (no way to expand out array in JSON Object)
*
*
Type information ("type id") is to be used: while this could work
* for some embedding methods, it would likely cause conflicts.
*
*
Object Identity ("object id") is used: while references would work,
* the problem is inclusion of id itself.
*
*
* Note that it is theoretically possible that last 2 issues could be addressed
* (by reserving room in array, for example); and if so, support improved.
*
* In cases where array-based output is not feasible, this serializer
* can instead delegate to the original Object-based serializer; this
* is why a reference is retained to the original serializer.
*
* @since 2.1
*/
public class BeanAsArraySerializer
extends BeanSerializerBase
{
private static final long serialVersionUID = 1L; // since 2.6
/**
* Serializer that would produce JSON Object version; used in
* cases where array output cannot be used.
*/
protected final BeanSerializerBase _defaultSerializer;
/*
/**********************************************************
/* Life-cycle: constructors
/**********************************************************
*/
public BeanAsArraySerializer(BeanSerializerBase src) {
super(src, (ObjectIdWriter) null);
_defaultSerializer = src;
}
protected BeanAsArraySerializer(BeanSerializerBase src, Set toIgnore) {
super(src, toIgnore);
_defaultSerializer = src;
}
protected BeanAsArraySerializer(BeanSerializerBase src,
ObjectIdWriter oiw, Object filterId) {
super(src, oiw, filterId);
_defaultSerializer = src;
}
/*
/**********************************************************
/* Life-cycle: factory methods, fluent factories
/**********************************************************
*/
@Override
public JsonSerializer