@@ -94,6 +94,7 @@ public Object parse(String s) throws ParseException {
94
94
/**
95
95
* Parse JSON Text into JSONObject from the input source, continuously reading until
96
96
* the end of the string
97
+ * @author Aurangzeb <[email protected] >
97
98
*
98
99
* @param in
99
100
*
@@ -110,6 +111,7 @@ public JSONObject parseToJSONObject( String s ) throws ParseException {
110
111
/**
111
112
* Parse JSON Text into JSONObject from the input source, continuously reading until
112
113
* the end of the string
114
+ * @author Aurangzeb <[email protected] >
113
115
*
114
116
* @param in
115
117
*
@@ -139,7 +141,7 @@ public void parse(String s, ContentHandler handler) throws ParseException {
139
141
throw new ParseException (-1 , ParseException .ERROR_UNEXPECTED_EXCEPTION , ie );
140
142
}
141
143
}
142
-
144
+
143
145
/**
144
146
* Parse JSON text into java object from the input source. Reads
145
147
* until end of the next JSON object, array, or value
@@ -157,6 +159,36 @@ public Object parse(Reader in) throws IOException, ParseException {
157
159
parse (in , handler );
158
160
return handler .getContent ();
159
161
}
162
+
163
+ /**
164
+ * Parse JSON text into java object from the input source. Reads
165
+ * until end of the next JSON object, array, or value
166
+ * @author Aurangzeb <[email protected] >
167
+ *
168
+ * @param in
169
+ * @return Instance of the following: org.json.simple.JSONObject
170
+ *
171
+ * @throws IOException
172
+ * @throws ParseException
173
+ */
174
+ public JSONObject parseToJSONObject ( Reader in ) throws IOException , ParseException {
175
+ return (JSONObject ) this .parse (in );
176
+ }
177
+
178
+ /**
179
+ * Parse JSON text into java object from the input source. Reads
180
+ * until end of the next JSON object, array, or value
181
+ * @author Aurangzeb <[email protected] >
182
+ *
183
+ * @param in
184
+ * @return Instance of the following: org.json.simple.JSONArray
185
+ *
186
+ * @throws IOException
187
+ * @throws ParseException
188
+ */
189
+ public JSONArray parseToJSONArray ( Reader in ) throws IOException , ParseException {
190
+ return (JSONArray ) this .parse (in );
191
+ }
160
192
161
193
/**
162
194
* Parse JSON text into java object from the input source.
0 commit comments