Skip to content

Commit f369612

Browse files
committed
add a standalone readme file for milestone 2
1 parent a84223d commit f369612

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README-M2.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Milestone 2
2+
3+
For the Milestone 2 of SWE262P, 2 new functions were added:
4+
5+
```java
6+
static JSONObject toJSONObject(Reader reader, JSONPointer path)
7+
static JSONObject toJSONObject(Reader reader, JSONPointer path, JSONObject replacement)
8+
```
9+
10+
The first one takes in 2 parameters, a `Reader` object which contains some XML input and a `JSONPointer` object that includes a json path for querying, and returns a `JSONObject` object which has the corresponding path, or throw an error if that path does not exist.
11+
12+
The first one takes in 3 parameters, a `Reader` object which contains some XML input and a `JSONPointer` object that includes a json path for querying, and a `JSONObject` for replacement. And returns a new `JSONObject` object which has the corresponding path replaced with the new given object, or throw an error if that path does not exist.
13+
14+
Both new functions are placed in the `XML.java` file.
15+
16+
The test cases of the functions are placed under the `org.json.junit.milestone2.tests` package, and to run the test case which deals with large file input, first create a folder named `xml_files` under the `/src/test/resources` path, and put the xml files for testing under this path.

0 commit comments

Comments
 (0)