Writing JSON
The JSON datatype supports writing JSON to Strings or Writers.
Writing to a String:
import static org.eximeebpms.spin.Spin.JSON;
SpinJsonNode jsonNode = JSON("{\"customer\": \"Kermit\"}");
String json = jsonNode.toString();
Writing to a Writer
import static org.eximeebpms.spin.Spin.JSON;
SpinJsonNode jsonNode = JSON("{\"customer\": \"Kermit\"}");
StringWriter writer = new StringWriter();
jsonNode.writeToWriter(writer);