- * Creates a JSON object from the given post. The JSON object will only
- * contain the ID of the post, its time, and its rendered HTML code.
- *
- * @param post
- * The post to create a JSON object from
- * @return The JSON representation of the post
- */
- private JsonObject createJsonPost(Post post) {
- JsonObject jsonPost = new JsonObject();
- jsonPost.put("id", post.getId());
- jsonPost.put("time", post.getTime());
- StringWriter stringWriter = new StringWriter();
- postTemplate.set("post", post);
- try {
- postTemplate.render(stringWriter);
- } catch (TemplateException te1) {
- /* TODO - shouldn’t happen. */
- } finally {
- Closer.close(stringWriter);
- }
- return jsonPost.put("html", stringWriter.toString());
- }
-
- /**
- * Creates a JSON object from the given reply. The JSON object will only
- * contain the ID of the reply, the ID of its post, its time, and its
- * rendered HTML code.
+ * Creates a JSON object that contains all options that are currently in
+ * effect for the given Sone (or overall, if the given Sone is {@code null}
+ * ).