Commit Graph

40 Commits

Author SHA1 Message Date
Marcono1234 4f948dd482
Automatically replace version references on `release:prepare` (#2212)
* Automatically replace version references on `release:prepare`

* Specify encoding and improve placeholder replacements

* Add `since $next-version$` for `JsonArray.asList` and `JsonObject.asMap`
2022-10-24 17:26:43 -07:00
Marcono1234 954d526af4
Add `JsonArray.asList` and `JsonObject.asMap` view methods (#2225)
* Add `JsonArray.asList` and `JsonObject.asMap` view methods

* Address review comments
2022-10-16 12:30:49 -07:00
Marcono1234 28609089fa
Add Javadoc since tags for previously added elements (#2211) 2022-10-01 15:58:26 -07:00
Marcono1234 847d7f6638
Improve documentation (#2193)
* Improve JsonElement subclasses javadoc and add tests

* Slightly improve JsonSerializer and JsonDeserializer javadoc

* Improve ReflectionAccessTest failure message

* Improve documentation regarding field and class exclusion
2022-09-09 07:32:55 -07:00
Marcono1234 51a72b463b
Make JsonElement conversion methods more consistent and fix javadoc (#2178)
* Make JsonElement conversion methods more consistent and fix javadoc

* Address some review comments
2022-08-21 13:29:40 -07:00
Marcono1234 246270e02c
Convert null to JsonNull for `JsonArray.set` (#2170)
* Convert null to JsonNull for `JsonArray.set`

All other methods perform the same implicit conversion.

* Mention null handling in JsonObject documentation
2022-08-06 09:57:00 -07:00
Marcono1234 0b6a7bf7d9
Deprecate JsonElement constructor (#1761)
* Deprecate JsonElement constructor

Creating custom JsonElement subclasses is discouraged.

* Improve test and documentation

* Improve JsonTreeReaderTest, adjust deprecation comments
2022-08-04 10:32:30 -07:00
Marcono1234 4dda4ec5ba
Use diamond operator when creating generic instances (#2104) 2022-04-17 15:27:21 -07:00
Marcono1234 49ddab9eeb
Add CodeQL GitHub code scanning workflow (#2076)
* Add CodeQL GitHub code scanning workflow

* Only compile main sources for code scanning

* Move test .proto  files to test sources

`annotations.proto` also seems to be only relevant for tests because the test
explicitly registers them as extensions. By default the Proto adapter does not
consider them.

* Address some code scanning findings

* Fix some more findings
2022-02-17 18:40:40 -08:00
Marcono1234 ca2ed748ba
Fix warnings (#2014)
* Fix warnings

* Address review feedback
2021-11-07 08:43:49 -08:00
Gabriel Basilio Brito fa947212e0
Add isEmpty method to JsonArray class (#1640)
The method will return true if the array is empty and false if it's not
2020-03-02 14:52:37 -08:00
inder123 3090a7ed2a Made deepCopy public (#1091)
* Made deepCopy public

* since 2.8.2
2017-05-31 10:33:37 -07:00
guptasourabh fd37cf1d0d JsonArray with capacity in constructor (#1033)
JsonArray with capacity in constructor
2017-03-12 19:59:41 -07:00
Psidium 61f58baaf9 fix typo in JsonArray docs 2016-01-12 11:02:42 -02:00
Dillon Dixon d8c12a727f Fixed accidental duplication of null elements 2015-07-23 21:18:01 -07:00
Dillon Dixon 6960ebc776 Updated JsonArray to support adding primitives directly via an overloaded "add(...)" method rather than having to always do "add(new JsonPrimitive(...))" 2015-07-23 20:44:04 -07:00
Inderjeet Singh f9a302e22a incorporated code review feedback. Added a test to ensure JsonAdapter validation doesn't carry side-effects to other fields 2014-08-01 02:16:42 +00:00
Inderjeet Singh 80bbf4a85a revised JsonArray.set() method to return the JsonElement. (thanks Buchholz Bastian for catching that!) 2014-07-04 17:31:43 +00:00
Inderjeet Singh b9578a4d7e renamed JsonArray.has() to JsonArray.contains() 2014-07-04 02:03:34 +00:00
Inderjeet Singh 94e21eca21 renamed JsonArray.contains() to has() to be consistent with JsonObject.has() 2014-07-03 17:31:07 +00:00
Inderjeet Singh 06282a4d13 Fixed issue code.google.com/p/google-gson/issues/detail?id=353 by adding set method in JsonArray 2014-07-02 18:30:17 +00:00
Inderjeet Singh 9bbdcac5a8 Fixed issue code.google.com/p/google-gson/issues/detail?id=353 by adding remove and contains methods in JsonArray 2014-07-02 18:21:36 +00:00
Jesse Wilson 411c5c0b50 Follow up on r1197 and make deepCopy package-private. We don't want to use protected because some of the classes are non-final and protected shows up in the Javadocs. 2012-09-03 23:30:27 +00:00
Inderjeet Singh a973837dd4 made deepCopy protected to eliminate it from the public API for now.
It will be in the subsequent release.
2012-09-03 08:34:37 +00:00
Jesse Wilson 9c4b23b39a JsonObject.deepCopy() for Gson. 2012-08-21 01:19:43 +00:00
Jesse Wilson 172143df7c Removing JsonObject.deepCopy() and JsonArray.deepCopy() 2011-11-12 23:32:44 +00:00
Jesse Wilson de727d8c48 Delete dead code found by coverage 2011-10-01 02:04:48 +00:00
Jesse Wilson 9cf579ef01 Use Streams instead of Escaper.
Fixes issue 345.
2011-07-12 23:50:00 +00:00
Jesse Wilson f74dffc6fd Add deepCopy to JsonArray and JsonObject.
Resolves issue 301.
2011-06-17 21:46:28 +00:00
Inderjeet Singh e79bcde8bf Using JsonNull.INSTANCE instead of JsonNull.createJsonNull() method 2011-05-25 16:55:57 +00:00
Inderjeet Singh feb9617bf0 Incorporated comments from r726 2011-04-04 22:09:51 +00:00
Jesse Wilson 3d006c90a2 equals & hashCode for subclasses of JsonElement.
Resolves issue 64.
2011-02-15 00:14:20 +00:00
Joel Leitch 93b0008486 Adding restrictions on the JsonElements to disallow Java "null"s. 2009-10-08 22:03:08 +00:00
Joel Leitch 50eb582657 Ensure that the JsonElement.toString() will always generate valid JSON (even when control characters/whitespace characters are used). 2009-09-23 18:28:03 +00:00
Inderjeet Singh cbcf7defa3 Updated Grammar for matching JsonArray to be left-associative rather than right-associative. Gson can now parse arrays of size over 11MB instead of 80KB which was the prior limit. Thanks for the tip, kenotron. 2009-08-22 01:03:27 +00:00
Inderjeet Singh 149604f0be Made author tags consistent across the public api. 2009-04-01 17:03:31 +00:00
Joel Leitch 6a80791f13 Code cleanup and some minor performance fixes. 2009-01-20 01:36:54 +00:00
Joel Leitch 0993d729e4 Added @since to the JavaDoc for the new methods added to JsonElement.
Suggested in the r296 code review.
2008-12-18 19:25:22 +00:00
Joel Leitch 0d8150fe52 Major restructuring of Primitve type serialization and deserializtion. From the end-user's point of view there should be no difference other than the user can now override the default serialization/deserialization their own custom type adapter (not sure if there is a real use-case out there for this).
This restructuring greatly cleans up the code and reduces some complexity; however, there is more that can be done to clean this up (i.e. get rid of "InstanceCreators" for primitive Type Adapters).
2008-11-15 02:26:57 +00:00
Inderjeet Singh 57d1f32de5 moved gson as a project under trunk 2008-09-01 03:13:32 +00:00