934 Commits

Author SHA1 Message Date
Rahul Kumar
310f18fcdc Addressed comment 2020-09-03 11:17:10 +05:30
Rahul Kumar
900a8cc945 Removed changes from depricated method 2020-08-06 07:29:32 +05:30
Rahul Kumar
0a8091c954 Added documentation 2020-08-05 22:25:45 +05:30
Rahul Kumar
61c1a882d6 Added configuration support for type conversion using Map 2020-08-03 08:54:59 +05:30
Rahul Kumar
250f74ef4d Added type conversion support 2020-08-03 08:18:20 +05:30
Sean Leary
5541a6d91d
Merge pull request #552 from johnjaylward/JSONArrayCopyConstructor
Updates for JSONArray.putAll methods
2020-08-01 09:19:29 -05:00
John J. Aylward
d30ecad7f8 Update README for best practices when using putAll on JSONArray 2020-07-30 10:13:01 -04:00
John J. Aylward
f35194bc1d Updates the addAll methods to have optional wrapping.
When called from the constructor, the individual items in the
collection/array are wrapped as done originally before the `putAll`
methods were added.

However this commit changes how `putAll` works. The items are no longer
wrapped in order to keep consistency with the other `put` methods.

However this can lead to inconsistencies with expectations. For example
code like this will create a mixed JSONArray, some items wrapped, others
not:

```java
SomeBean[] myArr = new SomeBean[]{ new SomeBean(1), new SomeBean(2) };
JSONArray jArr = new JSONArray(myArr); // these will be wrapped
// these will not be wrapped
jArr.putAll(new SomeBean[]{ new SomeBean(3), new SomeBean(4) });
```

For consistency, it would be recommended that the above code is changed
to look like 1 of 2 ways.

Option 1:
```Java
SomeBean[] myArr = new SomeBean[]{ new SomeBean(1), new SomeBean(2) };
JSONArray jArr = new JSONArray();
jArr.putAll(myArr); // will not be wrapped
// these will not be wrapped
jArr.putAll(new SomeBean[]{ new SomeBean(3), new SomeBean(4) });
// our jArr is now consistent.
```

Option 2:
```Java
SomeBean[] myArr = new SomeBean[]{ new SomeBean(1), new SomeBean(2) };
JSONArray jArr = new JSONArray(myArr); // these will be wrapped
// these will be wrapped
jArr.putAll(new JSONArray(new SomeBean[]{ new SomeBean(3), new
SomeBean(4) }));
// our jArr is now consistent.
```
2020-07-30 10:10:06 -04:00
John J. Aylward
5d828d2c0b update comments and increase speed of merging JSONArray objects 2020-07-30 10:10:06 -04:00
John J. Aylward
c175a9eb62 remove clone 2020-07-30 10:10:06 -04:00
John J. Aylward
3c9573cc3d update some javadoc 2020-07-30 10:10:06 -04:00
John J. Aylward
f37c2d67c5 Update for JSONArray.putAll methods
* Adds a copy constructor for JSONArray
* Updates the JSONArray.addAll(Object) method to be more lenient
* Adds support for JSONArray.putAll of generic Iterables
* Adds support for JSONArray.putAll of another JSONArray
2020-07-30 10:10:06 -04:00
Sean Leary
6351fa63aa
Merge pull request #549 from stleary/rewrite-readme
Update readme.md
2020-07-28 23:48:01 -05:00
Sean Leary
870fa03a19
Merge pull request #529 from ethauvin/master
Added putAll(Collection) and putAll(Array) methods.
2020-07-25 12:45:44 -05:00
Sean Leary
555f712a8c
Update README.md 2020-07-25 12:41:03 -05:00
Sean Leary
db2d1714de
Update README.md 2020-07-25 12:40:41 -05:00
Sean Leary
650f52501a
Update README.md 2020-07-25 12:36:53 -05:00
Sean Leary
896674ae36
Update README.md 2020-07-25 12:35:58 -05:00
Sean Leary
8f0c3b0bf8
Update README.md 2020-07-25 12:35:12 -05:00
Sean Leary
0de8d0d2e0
Update README.md 2020-07-25 12:34:01 -05:00
Sean Leary
46fe58e912
Update README.md 2020-07-25 12:31:20 -05:00
Sean Leary
26cd17687f
Update README.md 2020-07-25 12:31:02 -05:00
stleary
879fba3f7f rewrite - first commit 2020-07-25 12:27:20 -05:00
stleary
98cd8ef8b2 fix CI build error 2020-07-24 03:24:41 -05:00
Sean Leary
78528102d0
Merge pull request #543 from johnjaylward/RefactorXmlConfiguration
Refactor XMLConfiguration to use Builder Pattern
2020-07-24 02:49:28 -05:00
Sean Leary
0e34d8d383
Merge pull request #539 from stleary/unit-tests-1.6
Bring Junit tests to Java 1.6 compatibility
2020-07-24 02:48:38 -05:00
Sean Leary
880402120c
Merge pull request #542 from johnjaylward/fixXmlHexEntityParse
Fix xml hex entity parse
2020-07-23 11:02:14 -05:00
Sean Leary
d10725dc92
Merge pull request #538 from stleary/readme-local-build
Explain local builds in the readme, fix a couple of typos
2020-07-23 11:00:25 -05:00
Erik C. Thauvin
0d13e56064 Added tests for consecutive calls to putAll. 2020-07-21 23:09:28 -07:00
Erik C. Thauvin
f1d354ce7b Increase array list capacity in addAll(collection) method to ensure it can hold additional elements. 2020-07-21 17:35:32 -07:00
Erik C. Thauvin
86e136afc9 Increase array list capacity in addAll method to ensure it can hold additional elements. 2020-07-21 17:11:24 -07:00
John J. Aylward
4f1c8b2d6f formatting 2020-07-21 11:30:35 -04:00
John J. Aylward
5a31f9ef5f Refs #541
Updates XML configuration to use a builder pattern instead of
constructors with many parameters
2020-07-21 11:08:40 -04:00
John J. Aylward
c136668f23 remove new lines from test file text blocks to prevent issues with the
parsing compare on different operating systems
2020-07-20 18:58:00 -04:00
John J. Aylward
e18f42becc fixes #537 corrects case-sensitive entity unescape 2020-07-20 18:38:35 -04:00
John J. Aylward
e0a6c2ef34 refs #537 Show error when unescaping all-caps entity directly 2020-07-20 18:36:52 -04:00
John J. Aylward
c98da43184 Refs #537 Add test cases to verify no issue 2020-07-20 18:25:51 -04:00
John J. Aylward
734f182242 Update error messages to use the built in assertEquals 2020-07-20 18:25:22 -04:00
stleary
c63e78bbc7 initial commit 2020-07-18 17:14:39 -05:00
stleary
db6ca7fbf3 even more formatting 2020-07-18 13:11:13 -05:00
stleary
9a3e7dd7c4 more formatting 2020-07-18 13:08:38 -05:00
stleary
79ff79ed70 initial commit 2020-07-18 13:05:55 -05:00
stleary
d14c7b9127 formatting 2020-07-18 13:02:51 -05:00
stleary
de4395dc5e initial commit 2020-07-18 12:59:34 -05:00
Sean Leary
6ddaa13c1e
Merge pull request #532 from johnjaylward/CheckBigDecimalSupport
Verifies BigDecimal support does not have a regression
2020-06-25 17:02:18 -05:00
John J. Aylward
f9908a6adb adds comment on test case to document why it was added. 2020-06-25 11:51:46 -04:00
John J. Aylward
ba6c4089ea fixes #531
Add test result to confirm that #531 is working in latest version.
2020-06-25 11:42:07 -04:00
Erik C. Thauvin
aa0a5a7245 Added putAll(Collection) and putAll(Array) methods. 2020-06-16 14:55:16 -07:00
Sean Leary
9de97438ac
Merge pull request #524 from viveksacademia4git/i516-JSONArray-ConstructParam-InitCapacity
Development for stleary#516 completed with rebased repository
2020-06-12 10:48:21 -05:00
Sean Leary
601114ee29
Merge pull request #527 from johnjaylward/GithubAction
Fixes for Unit tests and supports GitHub Actions
2020-06-05 18:39:48 -05:00