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.IOException
public 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.IOException
public 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.IOException
public 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.IOException
public java.lang.String recordsToJsonForUpdate(long app, Record record) throws java.io.IOException
app
- application idrecord
- updated recordjava.io.IOException
public 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.IOException
public 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.IOException
public 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.IOException
public 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.IOException
public java.lang.String jsonToFileKey(java.lang.String json) throws java.io.IOException
json
- a json stringjava.io.IOException
public long jsonToRevision(java.lang.String json) throws java.io.IOException
json
- a json stringjava.io.IOException
public long jsonToId(java.lang.String json) throws java.io.IOException
json
- a json stringjava.io.IOException
public AppDto jsonToApp(java.lang.String json) throws java.io.IOException
json
- a json stringjava.io.IOException
public java.util.List<AppDto> jsonToApps(java.lang.String json) throws java.io.IOException
json
- a json stringjava.io.IOException
public 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.IOException
public 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.IOException
public 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.IOException
public 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.IOException
public java.lang.String generateForDeleteComment(long app, long record, long id) throws java.io.IOException
app
- application idrecord
- record idid
- comment idjava.io.IOException
public CommentSet jsonToCommentSet(Connection con, java.lang.String json) throws java.io.IOException
json
- a json stringjava.io.IOException