use of com.fasterxml.jackson.databind.util.NameTransformer in project jackson-databind by FasterXML.
the class ReferenceTypeSerializer method unwrappingSerializer.
@Override
public JsonSerializer<T> unwrappingSerializer(NameTransformer transformer) {
JsonSerializer<Object> valueSer = _valueSerializer;
if (valueSer != null) {
valueSer = valueSer.unwrappingSerializer(transformer);
}
NameTransformer unwrapper = (_unwrapper == null) ? transformer : NameTransformer.chainedTransformer(transformer, _unwrapper);
if ((_valueSerializer == valueSer) && (_unwrapper == unwrapper)) {
return this;
}
return withResolved(_property, _valueTypeSerializer, valueSer, unwrapper);
}
use of com.fasterxml.jackson.databind.util.NameTransformer in project jackson-databind by FasterXML.
the class UnwrappingBeanPropertyWriter method _findAndAddDynamic.
/*
/**********************************************************
/* Overrides: internal, other
/**********************************************************
*/
// need to override as we must get unwrapping instance...
@Override
protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializerProvider provider) throws JsonMappingException {
JsonSerializer<Object> serializer;
if (_nonTrivialBaseType != null) {
JavaType subtype = provider.constructSpecializedType(_nonTrivialBaseType, type);
serializer = provider.findValueSerializer(subtype, this);
} else {
serializer = provider.findValueSerializer(type, this);
}
NameTransformer t = _nameTransformer;
if (serializer.isUnwrappingSerializer()) {
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) serializer)._nameTransformer);
}
serializer = serializer.unwrappingSerializer(t);
_dynamicSerializers = _dynamicSerializers.newWith(type, serializer);
return serializer;
}
use of com.fasterxml.jackson.databind.util.NameTransformer in project jackson-databind by FasterXML.
the class UnwrappingBeanPropertyWriter method assignSerializer.
// need to override as we must get unwrapping instance...
@Override
public void assignSerializer(JsonSerializer<Object> ser) {
if (ser != null) {
NameTransformer t = _nameTransformer;
if (ser.isUnwrappingSerializer()) {
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) ser)._nameTransformer);
}
ser = ser.unwrappingSerializer(t);
}
super.assignSerializer(ser);
}
Aggregations