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

com.talanlabs.componentjackson.ComponentSerializer Maven / Gradle / Ivy

The newest version!
package com.talanlabs.componentjackson;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.talanlabs.component.IComponent;

import java.io.IOException;

public class ComponentSerializer extends StdSerializer {

    public ComponentSerializer() {
        super(IComponent.class);
    }

    @Override
    public void serialize(IComponent value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException {
        jgen.writeObject(value.straightGetProperties());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy