public class JsonParser
extends java.lang.Object
| Constructor and Description |
|---|
JsonParser() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
generateForAddComment(long app,
long record,
java.lang.String text,
java.util.List<MentionDto> mentions)
Generates the json string to add comment.
|
java.lang.String |
generateForDeleteComment(long app,
long record,
long id)
Generates the json string to delete comment.
|
java.lang.String |
generateForUpdateAssignees(long app,
long id,
java.util.List<java.lang.String> codes,
long revision)
Generates the json string to update assignees.
|
java.lang.String |
generateForUpdateStatus(long app,
java.util.List<java.lang.Long> ids,
java.util.List<java.lang.String> actions,
java.util.List<java.lang.String> assignees,
java.util.List<java.lang.Long> revisions)
Generates the json string to update status(for bulk updating).
|
java.lang.String |
generateForUpdateStatus(long app,
long id,
java.lang.String action,
java.lang.String assignee,
long revision)
Generates the json string to update status.
|
AppDto |
jsonToApp(java.lang.String json)
Convert json string to AppDto.
|
java.util.List<AppDto> |
jsonToApps(java.lang.String json)
Convert json string to AppDto array.
|
CommentSet |
jsonToCommentSet(Connection con,
java.lang.String json)
Converts the json string to the commentset object.
|
ErrorResponse |
jsonToErrorResponse(java.lang.String json)
Converts the json string to the error response object.
|
java.lang.String |
jsonToFileKey(java.lang.String json)
Retrieves the file key string from json string.
|
long |
jsonToId(java.lang.String json)
Retrieves the id string from json string.
|
java.util.List<java.lang.Long> |
jsonToIDs(java.lang.String json)
Retrieves the array of the ids from json string.
|
java.util.List<java.lang.Long> |
jsonToLongArray(java.lang.String json)
Retrieves the array of the Long values from json.
|
ResultSet |
jsonToResultSet(Connection con,
java.lang.String json)
Converts the json string to the resultset object.
|
long |
jsonToRevision(java.lang.String json)
Retrieves the revision string from json string.
|
java.lang.String |
recordsToJsonForDelete(long app,
java.util.List<Record> records)
Generates the json string for delete method.
|
java.lang.String |
recordsToJsonForInsert(long app,
java.util.List<Record> records)
Generates the json string for insert method.
|
java.lang.String |
recordsToJsonForUpdate(long app,
java.util.List<java.lang.Long> ids,
Record record)
Generates the json string for update method.
|
java.lang.String |
recordsToJsonForUpdate(long app,
java.util.List<Record> records)
Generates the json string for update method.
|
java.lang.String |
recordsToJsonForUpdate(long app,
Record record)
Generates the json string for update method.
|
java.lang.String |
recordsToJsonForUpdateByKey(long app,
java.lang.String key,
java.util.List<Record> records)
Generates the json string for update method.
|
java.lang.String |
recordsToJsonForUpdateByKey(long app,
java.lang.String key,
Record record)
Generates the json string for update method.
|
public ErrorResponse jsonToErrorResponse(java.lang.String json)
json - a json stringpublic ResultSet jsonToResultSet(Connection con, java.lang.String json) throws java.io.IOException
con - a connection objectjson - a json stringjava.io.IOExceptionpublic java.lang.String recordsToJsonForInsert(long app,
java.util.List<Record> records)
throws java.io.IOException
app - the application idrecords - the array of the record objectjava.io.IOExceptionpublic java.util.List<java.lang.Long> jsonToLongArray(java.lang.String json)
json - a json stringpublic java.util.List<java.lang.Long> jsonToIDs(java.lang.String json)
throws java.io.IOException
json - a json stringjava.io.IOExceptionpublic java.lang.String recordsToJsonForUpdate(long app,
java.util.List<java.lang.Long> ids,
Record record)
throws java.io.IOException
app - the application idids - the array of the record id to be updatedrecord - the values of updated recordsjava.io.IOExceptionpublic java.lang.String recordsToJsonForUpdate(long app,
Record record)
throws java.io.IOException
app - application idrecord - updated recordjava.io.IOExceptionpublic java.lang.String recordsToJsonForUpdate(long app,
java.util.List<Record> records)
throws java.io.IOException
app - the application idrecords - an array of the updated recordsjava.io.IOExceptionpublic java.lang.String recordsToJsonForUpdateByKey(long app,
java.lang.String key,
Record record)
throws java.io.IOException
app - application idkey - key field namerecord - updated recordjava.io.IOExceptionpublic java.lang.String recordsToJsonForUpdateByKey(long app,
java.lang.String key,
java.util.List<Record> records)
throws java.io.IOException
app - application idkey - key field namerecords - an array of the updated recordsjava.io.IOExceptionpublic java.lang.String recordsToJsonForDelete(long app,
java.util.List<Record> records)
throws java.io.IOException
app - the application idrecords - an array of the records to be deletedjava.io.IOExceptionpublic java.lang.String jsonToFileKey(java.lang.String json)
throws java.io.IOException
json - a json stringjava.io.IOExceptionpublic long jsonToRevision(java.lang.String json)
throws java.io.IOException
json - a json stringjava.io.IOExceptionpublic long jsonToId(java.lang.String json)
throws java.io.IOException
json - a json stringjava.io.IOExceptionpublic AppDto jsonToApp(java.lang.String json) throws java.io.IOException
json - a json stringjava.io.IOExceptionpublic java.util.List<AppDto> jsonToApps(java.lang.String json) throws java.io.IOException
json - a json stringjava.io.IOExceptionpublic java.lang.String generateForUpdateAssignees(long app,
long id,
java.util.List<java.lang.String> codes,
long revision)
throws java.io.IOException
id - record idcode - array of the code of the assigned usersrevision - revision number (-1 means "not set")java.io.IOExceptionpublic java.lang.String generateForUpdateStatus(long app,
long id,
java.lang.String action,
java.lang.String assignee,
long revision)
throws java.io.IOException
app - application idid - record idaction - action nameassignee - login name of the assigneerevision - revision number (-1 means "not set")java.io.IOExceptionpublic java.lang.String generateForUpdateStatus(long app,
java.util.List<java.lang.Long> ids,
java.util.List<java.lang.String> actions,
java.util.List<java.lang.String> assignees,
java.util.List<java.lang.Long> revisions)
throws java.io.IOException
app - application idids - an array of the record idactions - an array of the action nameassignees - an array of the login name of the assigneerevision - an array of the revision number (-1 means "not set")java.io.IOExceptionpublic java.lang.String generateForAddComment(long app,
long record,
java.lang.String text,
java.util.List<MentionDto> mentions)
throws java.io.IOException
app - application idrecord - record idmentions - an array of mentionsjava.io.IOExceptionpublic java.lang.String generateForDeleteComment(long app,
long record,
long id)
throws java.io.IOException
app - application idrecord - record idid - comment idjava.io.IOExceptionpublic CommentSet jsonToCommentSet(Connection con, java.lang.String json) throws java.io.IOException
json - a json stringjava.io.IOException