Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ser.impl;
 
 
 
Simple serializer that will call configured type serializer, passing in configured data serializer, and exposing it all as a simple serializer.
public final class TypeWrappedSerializer
    extends JsonSerializer<Object>
    final protected TypeSerializer _typeSerializer;
    final protected JsonSerializer<Object_serializer;
    @SuppressWarnings("unchecked")
    public TypeWrappedSerializer(TypeSerializer typeSerJsonSerializer<?> ser)
    {
        super();
         = typeSer;
         = (JsonSerializer<Object>) ser;
    }
    @Override
    public void serialize(Object valueJsonGenerator jgenSerializerProvider provider)
        throws IOExceptionJsonProcessingException
    {
        .serializeWithType(valuejgenprovider);
    }
    @Override
    public void serializeWithType(Object valueJsonGenerator jgenSerializerProvider provider,
            TypeSerializer typeSer)
        throws IOExceptionJsonProcessingException
    {
        /* Is this an erroneous call? For now, let's assume it is not, and
         * that type serializer is just overridden if so
         */
        .serializeWithType(valuejgenprovidertypeSer);
    }
    
    @Override
    public Class<ObjecthandledType() { return Object.class; }
New to GrepCode? Check out our FAQ X