maoruibin / maoruibin/maoruibin.github.com
判断字符串是不是 JSON 格式
Open
Nobody has claimed this yet.
utils
- Dominant language
- HTML
- Stars
- 22
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
/**
* check test string is json format or not
* @param test content
* @return true if it is format by json else return false
*/
public static boolean isJSONFormat(String test) {
try {
new JSONObject(test);
} catch (JSONException ex) {
try {
new JSONArray(test);
} catch (JSONException ex1) {
return false;
}
}
return true;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, test, or entry point is named; the issue only shows a Java method using JSONObject and JSONArray. First locate where this utility belongs and how JSON parsing is handled, then verify behavior for object, array, and invalid input with a project test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100