Search in sources :

Example 1 with NameTransformer

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);
}
Also used : NameTransformer(com.fasterxml.jackson.databind.util.NameTransformer)

Example 2 with NameTransformer

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;
}
Also used : NameTransformer(com.fasterxml.jackson.databind.util.NameTransformer) JavaType(com.fasterxml.jackson.databind.JavaType)

Example 3 with NameTransformer

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);
}
Also used : NameTransformer(com.fasterxml.jackson.databind.util.NameTransformer)

Aggregations

NameTransformer (com.fasterxml.jackson.databind.util.NameTransformer)3 JavaType (com.fasterxml.jackson.databind.JavaType)1