![JAR search and dependency download from the Maven repository](/logo.png)
org.avaje.ebeanorm.jackson.CommonBeanSerializer Maven / Gradle / Ivy
package org.avaje.ebeanorm.jackson;
import com.avaje.ebean.text.json.JsonContext;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
/**
* Serialise entity beans or collections.
*
* Simply delegates to Ebean's JsonContext.
*
*/
class CommonBeanSerializer extends JsonSerializer {
final JsonContext jsonContext;
/**
* Construct with the given JsonContext.
*/
CommonBeanSerializer(JsonContext jsonContext) {
this.jsonContext = jsonContext;
}
/**
* Serialize entity beans or collections.
*/
@Override
public void serialize(T o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
// could look to pass/use the active view
jsonContext.toJson(o, jsonGenerator);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy