Class RedmineJSONBuilder
- java.lang.Object
-
- com.taskadapter.redmineapi.internal.RedmineJSONBuilder
-
public class RedmineJSONBuilder extends java.lang.ObjectConverts Redmine objects to JSon format.
-
-
Constructor Summary
Constructors Constructor Description RedmineJSONBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddIfSetShort2(org.json.JSONWriter writer, java.lang.String jsonKeyName, PropertyStorage storage, Property<java.util.Date> property)static <T> java.lang.StringtoSimpleJSON(java.lang.String tag, T object, JsonObjectWriter<T> writer)Converts object to a "simple" json.static voidwriteCategory(org.json.JSONWriter writer, IssueCategory category)static voidwriteGroup(org.json.JSONWriter writer, Group group)static voidwriteIssue(org.json.JSONWriter writer, Issue issue)static voidwriteMembership(org.json.JSONWriter writer, Membership membership)static voidwriteProject(Project project, org.json.JSONWriter writer)static voidwriteProject(org.json.JSONWriter writer, Project project)Writes a "create project" request.static voidwriteUpload(org.json.JSONWriter writer, Attachment attachment)static voidwriteUser(org.json.JSONWriter writer, User user)static voidwriteWatchers(org.json.JSONWriter writer, java.util.Collection<Watcher> watchers)static voidwriteWikiPageDetail(org.json.JSONWriter writer, WikiPageDetail detail)
-
-
-
Method Detail
-
writeProject
public static void writeProject(org.json.JSONWriter writer, Project project) throws java.lang.IllegalArgumentException, org.json.JSONExceptionWrites a "create project" request.- Parameters:
writer- project writer.project- project to create.- Throws:
java.lang.IllegalArgumentException- if some project fields are not configured.org.json.JSONException- if IO error occurs.
-
toSimpleJSON
public static <T> java.lang.String toSimpleJSON(java.lang.String tag, T object, JsonObjectWriter<T> writer) throws RedmineInternalErrorConverts object to a "simple" json.- Parameters:
tag- object tag.object- object to convert.writer- object writer.- Returns:
- object String representation.
- Throws:
RedmineInternalError- if conversion fails.
-
writeProject
public static void writeProject(Project project, org.json.JSONWriter writer) throws org.json.JSONException
- Throws:
org.json.JSONException
-
writeCategory
public static void writeCategory(org.json.JSONWriter writer, IssueCategory category) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeUser
public static void writeUser(org.json.JSONWriter writer, User user) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeGroup
public static void writeGroup(org.json.JSONWriter writer, Group group) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeIssue
public static void writeIssue(org.json.JSONWriter writer, Issue issue) throws org.json.JSONException- Throws:
org.json.JSONException
-
addIfSetShort2
public static void addIfSetShort2(org.json.JSONWriter writer, java.lang.String jsonKeyName, PropertyStorage storage, Property<java.util.Date> property) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeUpload
public static void writeUpload(org.json.JSONWriter writer, Attachment attachment) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeMembership
public static void writeMembership(org.json.JSONWriter writer, Membership membership) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeWatchers
public static void writeWatchers(org.json.JSONWriter writer, java.util.Collection<Watcher> watchers) throws org.json.JSONException- Throws:
org.json.JSONException
-
writeWikiPageDetail
public static void writeWikiPageDetail(org.json.JSONWriter writer, WikiPageDetail detail) throws org.json.JSONException- Throws:
org.json.JSONException
-
-