1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00
Commit graph

55 commits

Author SHA1 Message Date
Sean Leary
1add1247fa Merge pull request #348 from johnjaylward/ArrayPerformance
Capacity improvements for internal structures
2017-06-12 02:05:26 -05:00
John J. Aylward
3645f91b55 change JSONArray(Collection) constructor to use the default capacity when a null collection is passed 2017-06-08 12:15:03 -04:00
John J. Aylward
9c092753b0 * Updates array constructor and bulk operations to best guess capacity information
* Update JSONObject to allow best guess for initial capacity.
2017-06-08 11:22:23 -04:00
John J. Aylward
ad6bdd715d Adds JSONException for write value errors so serialization errors can be tracked easier 2017-06-05 20:51:57 -04:00
John J. Aylward
4f5bf16676 * Adds protected entrySet accessor to JSONObject
* Updates loops that request key/value pairs to use the new entrySet accessor
2017-05-23 12:48:44 -04:00
John J. Aylward
757b6edb03 Merge branch 'master' of github.com:stleary/JSON-java into OptimizeOpt 2017-05-21 13:12:24 -04:00
John J. Aylward
04d6e83fc2 * Missed JSONArray optFloat and optDouble for the revert
* prevents erasure of stack trace for rethrown exceptions
2017-05-19 09:49:22 -04:00
John J. Aylward
849b392c01 updates the getNumber/optNumber to not return invalid Doubles 2017-05-18 19:49:50 -04:00
John J. Aylward
1ab5260a7a * Adds methods getNUmber and getFloat to JSONArray and JSONObject
* Extracts the stringToNumber logic that the optNumber method uses to reuse it between classes
* Fixes -0 issue with optNumber/getNumber
2017-05-18 14:24:34 -04:00
John J. Aylward
0c7bd725a6 fixes for javadoc 2017-05-17 11:34:37 -04:00
John J. Aylward
fcdb8671b2 grr, forgot to save changes on last commit 2017-05-17 11:32:44 -04:00
John J. Aylward
c46774cf13 * Update opt* methods for JSONArray
* Add support to JSONArray and JSONObject to optionally get raw number values
* Add support to JSONArray and JSONObject to optionally get float values
2017-05-17 11:29:26 -04:00
John J. Aylward
c870094f69 Fixes spelling in comments and removes compile time warnings 2017-05-16 15:35:05 -04:00
alessandro rao
2917104b53 Allow user to invoke query and optQuery ,with a JSONPointer,directly
from JSONArray or JSONObject fix JSONArray
2017-02-25 14:35:02 +01:00
alessandro rao
9e0fc5e680 Allow user to invoke query and optQuery ,with a JSONPointer,directly
from JSONArray or JSONObject
2017-02-25 13:27:50 +01:00
Sean Leary
f96f505188 Update JSONArray.java
Fixed a Javadoc typo, originally fixed in #249, since reverted. This is to address issue #263
2016-08-15 01:53:08 -05:00
Sean Leary
45a7decba4 Revert "reduces the use of unnecessary exceptions" 2016-08-09 14:22:06 -05:00
Nils Faupel
3890bfae52 reduce the use of unnecessary exceptions 2016-07-19 19:59:30 +02:00
Nils Faupel
abf2963bbe Revert "reduces the use of unnecessary exceptions"
This reverts commit 7627d40d10.
2016-07-19 19:00:42 +02:00
Simulant
7627d40d10 reduces the use of unnecessary exceptions 2016-07-08 22:17:05 +02:00
Sean Leary
808320801a Update JSONArray.java
Update version timestamp
2016-05-20 21:09:53 -05:00
Sean Leary
b2bde1f468 Merge pull request #234 from erosb/master
fixing stleary/JSON-Java#233
2016-05-20 21:03:06 -05:00
Bence Erős
56be31e7a8 fixing stleary/JSON-Java#233 2016-05-16 14:53:34 +02:00
stleary
4a458a9f1c add timestamps to recent commits, javadocs for JSONObject, JSONArray queryFrom() methods 2016-05-14 09:22:18 -05:00
Bence Erős
45bd72c15d added JSONObject#query() and JSONPointer#query() methods 2016-04-26 23:48:14 +02:00
Sean Leary
2f3af56535 Update date of merge. 2016-03-05 15:19:45 -06:00
Joe Ferner
f024b52108 Adds JSONArray toList method and JSONObject toMap method 2016-02-27 11:20:25 -05:00
skreutzer
60349ece54 Java 1.6 compatibility. 2016-02-08 23:30:27 -05:00
stleary
8688494876 change to public, write(writer, indentfactor, indent) 2015-12-23 19:53:30 -06:00
Sean Leary
a109f581c8 Update JSONArray.java
Update version for https://github.com/douglascrockford/JSON-java/pull/153
2015-10-29 18:25:27 -05:00
Lukas Treyer
25b5aa7ef2 changed Map<String, ?> method parameters to Map<?,?>
changed Iterator to foreach loop in JSONArray ctor
JSONArray(Collection<?> collection) and JSONObject ctor
JSONObject(Map<?,?> map)
2015-10-11 12:21:12 +02:00
Lukas Treyer
409eb9f292 changed all method signatures containing collections and maps to accept
wildcard generic types, e.g. Collection<?> instead of
Collection<Object>. This was proposed by other pull requests (#111,
#112) already. Consider this commit as merge with #111 and #112.

JSONArray:
	- put(Collection<?> value) {...}
	- put(Map<String, ?> value) {...}
	- put(int index, Collection<?> value) throws JSONException {...}
	- put(int index, Map<String, ?> value) throws JSONException {...}

JSONObject:
	- put(String key, Collection<?> value) throws JSONException {...}
	- put(String key, Map<String, ?> value) throws JSONException {...}


Changed all code affected by new JSONObject and JSONArray constructors:
	
JSONObject:
	- valueToString(Object value) throws JSONException {
		- value instanceof Map
		- value instanceof Collection
	  }
	- wrap(Object object) {
		- value instanceof Map
		- value instanceof Collection
	  }
	- writeValue(Writer writer, Object value,
			 int indentFactor, int indent){
        - value instanceof Map
        - value instanceof Collection
      }
2015-10-11 11:20:08 +02:00
Lukas Treyer
0afd26623c JSONObject and JSONArray initialization:
JSONObject(Map<String, ?> map) allows to initialize the JSONObject with
a Map<String, String>

JSONArray(Collection<?> collection) allows to initialize a JSONArray
with a Collection<JSONObject>
2015-10-04 23:17:30 +02:00
stleary
5fc22e32a8 fix edit dates for enum support 2015-07-22 20:18:30 -05:00
stleary
9785b4ff0b enum support 2015-07-22 20:16:02 -05:00
stleary
ca3001629a latest 2015-07-22 20:11:07 -05:00
stleary
71d9ad2b99 update version dates 2015-07-06 22:27:10 -05:00
stleary
410afaff14 latest 2015-07-06 22:20:19 -05:00
stleary
6ab6f063c8 latest 2015-07-03 20:41:47 -05:00
stleary
d2cd1a8df5 iterable 2015-06-04 22:26:16 -05:00
Douglas Crockford
a9a0762383 Java 1.8. 2014-05-05 15:09:32 -07:00
Douglas Crockford
7ff3fa4e40 similar 2014-04-21 16:11:51 -07:00
Douglas Crockford
cdaaf12557 JSONArray.remove 2014-04-18 16:16:03 -07:00
Douglas Crockford
a360c40b74 Disallow ; and => 2013-04-19 11:09:16 -07:00
Douglas Crockford
b883a848a6 backout 2013-02-19 18:26:31 -08:00
Douglas Crockford
ae8d12c5f4 iterator 2013-02-19 04:49:21 -08:00
Douglas Crockford
216a4299f3 toString 2012-11-13 14:26:15 -08:00
Douglas Crockford
9115ada84d Performance improvments by Valentin Valchev 2012-04-22 16:52:45 -07:00
unknown
6394d92279 optString 2011-12-19 17:31:55 -08:00
Douglas Crockford
806900e0d1 Remove 0x- 2011-11-24 07:45:34 -08:00