![JAR search and dependency download from the Maven repository](/logo.png)
org.mnode.ical4j.json.jscalendar.AbstractJSCalendarBuilder 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.jscalendar;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.mnode.ical4j.json.JsonBuilder;
public abstract class AbstractJSCalendarBuilder implements JsonBuilder {
private final String objectType;
protected T component;
public AbstractJSCalendarBuilder(String objectType) {
this.objectType = objectType;
}
public AbstractJSCalendarBuilder component(T component) {
this.component = component;
return this;
}
protected ObjectNode createObjectNode() {
ObjectMapper mapper = new ObjectMapper();
ObjectNode node = mapper.createObjectNode();
node.put("@type", objectType);
return node;
}
/**
* Build a JSON node representing the JSCalendar object.
* @return a JSON representation of a JSCalendar object
*/
public abstract JsonNode build();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy