com.couchbase.client.deps.com.fasterxml.jackson.databind.jsontype.impl.AsExternalTypeDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-io Show documentation
Show all versions of core-io Show documentation
The official Couchbase JVM Core IO Library
package com.couchbase.client.deps.com.fasterxml.jackson.databind.jsontype.impl;
import com.couchbase.client.deps.com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.couchbase.client.deps.com.fasterxml.jackson.databind.BeanProperty;
import com.couchbase.client.deps.com.fasterxml.jackson.databind.JavaType;
import com.couchbase.client.deps.com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.couchbase.client.deps.com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
/**
* Type deserializer used with {@link As#EXTERNAL_PROPERTY} inclusion mechanism.
* Actual implementation may look bit strange since it depends on comprehensive
* pre-processing done by {@link com.couchbase.client.deps.com.fasterxml.jackson.databind.deser.BeanDeserializer}
* to basically transform external type id into structure that looks more like
* "wrapper-array" style inclusion. This intermediate form is chosen to allow
* supporting all possible JSON structures.
*/
public class AsExternalTypeDeserializer extends AsArrayTypeDeserializer
{
private static final long serialVersionUID = 1L;
public AsExternalTypeDeserializer(JavaType bt, TypeIdResolver idRes,
String typePropertyName, boolean typeIdVisible, Class defaultImpl)
{
super(bt, idRes, typePropertyName, typeIdVisible, defaultImpl);
}
public AsExternalTypeDeserializer(AsExternalTypeDeserializer src, BeanProperty property) {
super(src, property);
}
@Override
public TypeDeserializer forProperty(BeanProperty prop) {
if (prop == _property) { // usually if it's null
return this;
}
return new AsExternalTypeDeserializer(this, prop);
}
@Override
public As getTypeInclusion() { return As.EXTERNAL_PROPERTY; }
}