com.vicrab.marshaller.json.InterfaceBinding Maven / Gradle / Ivy
package com.vicrab.marshaller.json;
import com.fasterxml.jackson.core.JsonGenerator;
import com.vicrab.event.interfaces.VicrabInterface;
import java.io.IOException;
/**
* An interface binding allows to encore a {@link VicrabInterface} of a specific type into a JSON stream.
*
* @param type of {@link VicrabInterface} supported by the binder.
*/
public interface InterfaceBinding {
/**
* Encodes the content of a vicrab interface into a JSON stream.
*
* @param generator JSON generator allowing to write JSON content.
* @param vicrabInterface interface to encode.
* @throws IOException thrown in case of failure during the generation of JSON content.
*/
void writeInterface(JsonGenerator generator, T vicrabInterface) throws IOException;
}