![JAR search and dependency download from the Maven repository](/logo.png)
org.mnode.ical4j.json.jot.JotCardSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ical4j-json Show documentation
Show all versions of ical4j-json Show documentation
Custom marshalling between iCal4j objects and JSON formats
The newest version!
package org.mnode.ical4j.json.jot;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import net.fortuna.ical4j.vcard.VCard;
import java.io.IOException;
public class JotCardSerializer extends StdSerializer {
public JotCardSerializer(Class t) {
super(t);
}
@Override
public void serialize(VCard value, JsonGenerator gen, SerializerProvider provider) throws IOException {
gen.writeTree(buildCard(value));
}
private JsonNode buildCard(VCard card) {
AbstractJotBuilder builder = new CardBuilder().component(card);
return builder.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy