com.github.dikhan.utils.JSONObjectSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pagerduty-client Show documentation
Show all versions of pagerduty-client Show documentation
Simple Java PagerDuty client with full integration with PagerDuty Events APIs
package com.github.dikhan.utils;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.json.JSONObject;
import java.io.IOException;
public class JSONObjectSerializer extends StdSerializer{
public JSONObjectSerializer() {
this(null);
}
public JSONObjectSerializer(Class jsonObject) {
super(jsonObject);
}
@Override
public void serialize(JSONObject jsonObject, JsonGenerator jgen,
SerializerProvider provider) throws IOException{
jgen.writeRawValue(jsonObject.toString());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy