io.prestosql.jdbc.$internal.jackson.databind.deser.std.ContainerDeserializerBase Maven / Gradle / Ivy
The newest version!
package io.prestosql.jdbc.$internal.jackson.databind.deser.std;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import io.prestosql.jdbc.$internal.jackson.databind.*;
import io.prestosql.jdbc.$internal.jackson.databind.deser.NullValueProvider;
import io.prestosql.jdbc.$internal.jackson.databind.deser.SettableBeanProperty;
import io.prestosql.jdbc.$internal.jackson.databind.deser.ValueInstantiator;
import io.prestosql.jdbc.$internal.jackson.databind.deser.impl.NullsConstantProvider;
import io.prestosql.jdbc.$internal.jackson.databind.type.TypeFactory;
import io.prestosql.jdbc.$internal.jackson.databind.util.AccessPattern;
import io.prestosql.jdbc.$internal.jackson.databind.util.ClassUtil;
/**
* Intermediate base deserializer class that adds more shared accessor
* so that other classes can access information about contained (value) types
*/
@SuppressWarnings("serial")
public abstract class ContainerDeserializerBase
extends StdDeserializer
implements ValueInstantiator.Gettable // since 2.9
{
protected final JavaType _containerType;
/**
* Handler we need for dealing with nulls.
*
* @since 2.9
*/
protected final NullValueProvider _nullProvider;
/**
* Marker flag set if the _nullProvider
indicates that all null
* content values should be skipped (instead of being possibly converted).
*
* @since 2.9
*/
protected final boolean _skipNullValues;
/**
* Specific override for this instance (from proper, or global per-type overrides)
* to indicate whether single value may be taken to mean an unwrapped one-element array
* or not. If null, left to global defaults.
*
* @since 2.9 (demoted from sub-classes where added in 2.7)
*/
protected final Boolean _unwrapSingle;
protected ContainerDeserializerBase(JavaType selfType,
NullValueProvider nuller, Boolean unwrapSingle) {
super(selfType);
_containerType = selfType;
_unwrapSingle = unwrapSingle;
_nullProvider = nuller;
_skipNullValues = NullsConstantProvider.isSkipper(nuller);
}
protected ContainerDeserializerBase(JavaType selfType) {
this(selfType, null, null);
}
/**
* @since 2.9
*/
protected ContainerDeserializerBase(ContainerDeserializerBase> base) {
this(base, base._nullProvider, base._unwrapSingle);
}
/**
* @since 2.9
*/
protected ContainerDeserializerBase(ContainerDeserializerBase> base,
NullValueProvider nuller, Boolean unwrapSingle) {
super(base._containerType);
_containerType = base._containerType;
_nullProvider = nuller;
_unwrapSingle = unwrapSingle;
_skipNullValues = NullsConstantProvider.isSkipper(nuller);
}
/*
/**********************************************************
/* Overrides
/**********************************************************
*/
@Override // since 2.9
public JavaType getValueType() { return _containerType; }
@Override // since 2.9
public Boolean supportsUpdate(DeserializationConfig config) {
return Boolean.TRUE;
}
@Override
public SettableBeanProperty findBackReference(String refName) {
JsonDeserializer