public class RedmineJSONBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static JsonObjectWriter<IssueCategory> |
CATEGORY_WRITER |
static JsonObjectWriter<Group> |
GROUP_WRITER |
static JsonObjectWriter<Issue> |
ISSUE_WRITER |
static JsonObjectWriter<Membership> |
MEMBERSHIP_WRITER |
static JsonObjectWriter<Project> |
PROJECT_WRITER |
static JsonObjectWriter<IssueRelation> |
RELATION_WRITER |
static JsonObjectWriter<TimeEntry> |
TIME_ENTRY_WRITER |
static JsonObjectWriter<Attachment> |
UPLOAD_WRITER |
static JsonObjectWriter<User> |
USER_WRITER |
static JsonObjectWriter<Version> |
VERSION_WRITER |
Constructor and Description |
---|
RedmineJSONBuilder() |
Modifier and Type | Method and Description |
---|---|
static void |
addFull(org.json.JSONWriter writer,
java.lang.String field,
java.util.Date value)
Adds a value to a writer.
|
static void |
addIfNotNullFull(org.json.JSONWriter writer,
java.lang.String field,
java.util.Date value)
Adds a value to a writer if value is not
null . |
static void |
addIfNotNullShort(org.json.JSONWriter writer,
java.lang.String field,
java.util.Date value)
Adds a value to a writer if value is not
null . |
static void |
addIfNotNullShort2(org.json.JSONWriter writer,
java.lang.String field,
java.util.Date value)
Adds a value to a writer if value is not
null . |
static void |
addShort2(org.json.JSONWriter writer,
java.lang.String field,
java.util.Date value)
Adds a value to a writer.
|
static <T> java.lang.String |
toSimpleJSON(java.lang.String tag,
T object,
JsonObjectWriter<T> writer)
Converts object to a "simple" json.
|
static void |
writeCategory(IssueCategory category,
org.json.JSONWriter writer) |
static void |
writeGroup(Group group,
org.json.JSONWriter writer) |
static void |
writeIssue(Issue issue,
org.json.JSONWriter writer) |
static void |
writeMembership(org.json.JSONWriter writer,
Membership membership) |
static void |
writeProject(org.json.JSONWriter writer,
Project project)
Writes a "create project" request.
|
static void |
writeProject(Project project,
org.json.JSONWriter writer) |
static void |
writeUpload(org.json.JSONWriter writer,
Attachment attachment) |
static void |
writeUser(User user,
org.json.JSONWriter writer) |
static void |
writeWatchers(org.json.JSONWriter writer,
java.util.Collection<Watcher> watchers) |
public static final JsonObjectWriter<Project> PROJECT_WRITER
public static final JsonObjectWriter<Issue> ISSUE_WRITER
public static final JsonObjectWriter<User> USER_WRITER
public static final JsonObjectWriter<Group> GROUP_WRITER
public static final JsonObjectWriter<IssueRelation> RELATION_WRITER
public static final JsonObjectWriter<IssueCategory> CATEGORY_WRITER
public static final JsonObjectWriter<Version> VERSION_WRITER
public static final JsonObjectWriter<TimeEntry> TIME_ENTRY_WRITER
public static final JsonObjectWriter<Attachment> UPLOAD_WRITER
public static final JsonObjectWriter<Membership> MEMBERSHIP_WRITER
public static void writeProject(org.json.JSONWriter writer, Project project) throws java.lang.IllegalArgumentException, org.json.JSONException
writer
- project writer.project
- project to create.java.lang.IllegalArgumentException
- if some project fields are not configured.org.json.JSONException
- if IO error occurs.public static <T> java.lang.String toSimpleJSON(java.lang.String tag, T object, JsonObjectWriter<T> writer) throws RedmineInternalError
tag
- object tag.object
- object to convert.writer
- object writer.RedmineInternalError
- if conversion fails.public static void writeProject(Project project, org.json.JSONWriter writer) throws org.json.JSONException
org.json.JSONException
public static void writeCategory(IssueCategory category, org.json.JSONWriter writer) throws org.json.JSONException
org.json.JSONException
public static void writeUser(User user, org.json.JSONWriter writer) throws org.json.JSONException
org.json.JSONException
public static void writeGroup(Group group, org.json.JSONWriter writer) throws org.json.JSONException
org.json.JSONException
public static void writeIssue(Issue issue, org.json.JSONWriter writer) throws org.json.JSONException
org.json.JSONException
public static void writeUpload(org.json.JSONWriter writer, Attachment attachment) throws org.json.JSONException
org.json.JSONException
public static void writeMembership(org.json.JSONWriter writer, Membership membership) throws org.json.JSONException
org.json.JSONException
public static void writeWatchers(org.json.JSONWriter writer, java.util.Collection<Watcher> watchers) throws org.json.JSONException
org.json.JSONException
public static void addIfNotNullFull(org.json.JSONWriter writer, java.lang.String field, java.util.Date value) throws org.json.JSONException
null
.writer
- writer to add object to.field
- field name to set.value
- field value.org.json.JSONException
- if io error occurs.public static void addFull(org.json.JSONWriter writer, java.lang.String field, java.util.Date value) throws org.json.JSONException
writer
- writer to add object to.field
- field name to set.value
- field value.org.json.JSONException
- if io error occurs.public static void addIfNotNullShort(org.json.JSONWriter writer, java.lang.String field, java.util.Date value) throws org.json.JSONException
null
.writer
- writer to add object to.field
- field name to set.value
- field value.org.json.JSONException
- if io error occurs.public static void addIfNotNullShort2(org.json.JSONWriter writer, java.lang.String field, java.util.Date value) throws org.json.JSONException
null
.writer
- writer to add object to.field
- field name to set.value
- field value.org.json.JSONException
- if io error occurs.public static void addShort2(org.json.JSONWriter writer, java.lang.String field, java.util.Date value) throws org.json.JSONException
writer
- writer to add object to.field
- field name to set.value
- field value.org.json.JSONException
- if io error occurs.