All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.jackson.map.ser.ContainerSerializerBase Maven / Gradle / Ivy

Go to download

Data Mapper package is a high-performance data binding package built on Jackson JSON processor

There is a newer version: 1.9.13
Show newest version
package org.codehaus.jackson.map.ser;

import org.codehaus.jackson.map.TypeSerializer;

/**
 * Intermediate base class for types that contain element(s) of
 * other types. Used for example for List, Map, Object array and
 * Iterator serializers.
 * 
 * @since 1.5
 */
public abstract class ContainerSerializerBase
    extends SerializerBase
{
    /*
    /*********************************************
    /* Construction, initialization
    /*********************************************
     */

    protected ContainerSerializerBase(Class t) {
        super(t);
    }
    
    /**
     * Alternate constructor that is (alas!) needed to work
     * around kinks of generic type handling
     * 
     * @param t
     */
    protected ContainerSerializerBase(Class t, boolean dummy) {
        super(t, dummy);
    }

    /**
     * Factory(-like) method that can be used to construct a new container
     * serializer that uses specified {@link TypeSerializer} for decorating
     * contained values with additiona type information.
     * 
     * @param vts Type serializer to use for contained values; can be null,
     *    in which case 'this' serializer is returned as is
     * @return Serializer instance that uses given type serializer for values if
     *    that is possible (or if not, just 'this' serializer)
     */
    public ContainerSerializerBase withValueTypeSerializer(TypeSerializer vts) {
        if (vts == null) return this;
        return _withValueTypeSerializer(vts);
    }

    public abstract ContainerSerializerBase _withValueTypeSerializer(TypeSerializer vts);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy