Commit Graph

1295 Commits

Author SHA1 Message Date
Inderjeet Singh
4512f31c69 Added PostConstruct Factory sample in Extras. 2016-09-16 17:35:34 -07:00
inder123
2271525dd5 Merge pull request #900 from google/jw/array-and-parameterized-factories
Add static factories for array and parameterized type tokens.
2016-08-12 09:58:55 -07:00
Jake Wharton
9414b9b3b6 Add static factories for array and parameterized type tokens.
These are useful when creating TypeAdapterFactories that delegate to others with more complex types. They also are useful when writing dynamic code that deals with types that cannot be fully reified using the normal subclass technique.
2016-08-12 12:11:57 -04:00
inder123
8b464231f7 Merge pull request #881 from testcenter/master
made nullSafe wrapper of JsonAdapter optional
2016-07-03 01:53:19 -07:00
testcenter
193349f4aa made nullSafe wrapper of JsonAdapter optional 2016-06-28 09:18:03 +02:00
inder123
f482f4a1cb ChangeLog for 2.7 2016-06-14 17:22:32 -07:00
inder123
28c8e1c29b Updated to 2.7 2016-06-14 17:07:51 -07:00
Inderjeet Singh
0a29fcf859 [maven-release-plugin] prepare for next development iteration 2016-06-14 16:52:32 -07:00
Inderjeet Singh
9722b00372 [maven-release-plugin] prepare release gson-parent-2.7 2016-06-14 16:52:28 -07:00
inder123
86765d2331 Merge pull request #875 from google/gson_2.7
Preparing 2.7-SNAPSHOT to cut the 2.7 release.
2016-06-14 16:46:57 -07:00
Inderjeet Singh
687ddb319e Preparing 2.7-SNAPSHOT to cut the 2.7 release. 2016-06-14 16:39:19 -07:00
inder123
b2c00a3b02 Merge pull request #873 from google/jwilson.0601.get_delegate_adapter
Add support for JsonSerializer/JsonDeserializer in the JsonAdapter annotation
2016-06-14 16:37:14 -07:00
Inderjeet Singh
1f859ec769 addressed code review comments. 2016-06-14 16:34:34 -07:00
Jesse Wilson
c24af30407 Merge pull request #871 from google/jw/tree-json-path
Implement JSON Path for JsonTreeReader.
2016-06-09 23:32:24 -07:00
Jesse Wilson
5f63fcec98 Merge pull request #872 from google/jw/object-size
Expose JsonObject size.
2016-06-09 23:06:50 -07:00
Jake Wharton
c16be41e77 Expose JsonObject size. 2016-06-10 00:46:32 -04:00
Jake Wharton
c2fae85a9f Implement JSON Path for JsonTreeReader. 2016-06-10 00:14:28 -04:00
inder123
ebad966efd Merge pull request #870 from google/jw/reader-location
Consolidate location and path rendering for exceptions.
2016-06-09 15:26:10 -07:00
Jake Wharton
ecaa57114f Consolidate location and path rendering for exceptions. 2016-06-09 18:02:36 -04:00
jwilson
86ccf826fc Merge branch 'deyboy90-master'
* deyboy90-master:
  Enhancing the json reader, adding corresponding test case for it
2016-06-02 09:20:06 -04:00
Archit Dey
3f8726ecaf Enhancing the json reader, adding corresponding test case for it 2016-06-02 09:19:43 -04:00
jwilson
2df65502ed Don't use ThreadLocals for @JsonAdapter factories and getDelegateAdapter(). 2016-06-02 00:33:09 -04:00
Inderjeet Singh
943c674276 Removed ThreadLocal for activeJsonAdapterClasses 2016-06-02 00:08:25 -04:00
Inderjeet Singh
45511fdd15 Added support for JsonSerializer/JsonDeserializer for JsonAdapter annotation.
JsonAdapter is cached per the type of the JsonAdapter class.
Added a test to ensure JsonAdapter works on fields of parameterized types
Keep track of registered JsonAdapters and JsonAdapterFactorys in ThreadLocal.
2016-06-02 00:08:25 -04:00
Jake Wharton
daa92e3fdc Merge pull request #865 from juandiana/runtimetypeadapterfactory-docs-fix
Fix registerTypeAdapterFactory method usage
2016-05-25 15:10:18 -04:00
Juan Andrés Diana
86d88c32cf The method registerTypeAdapterFactory accepts a TypeAdapterFactory instance only. 2016-05-25 15:49:39 -03:00
inder123
854760e6c7 Merge pull request #864 from juandiana/runtimetypeadapterfactory-docs-fix
Minor documentation fix on RuntimeTypeAdapterFactory
2016-05-24 13:58:21 -07:00
Juan Andrés Diana
d4a9eb4e7b Docs fix for the RuntimeTypeAdapterFactory class.
Instances of classes that implement RuntimeTypeAdapterFactory should be registered using the registerTypeAdapterFactory method instead of registerTypeAdapter.
2016-05-24 16:45:55 -03:00
inder123
2360cfa05c Merge pull request #863 from nykolaslima/explicit-null-in-json
handle explicit null values in JSON
2016-05-23 23:17:54 -07:00
Nykolas Lima
2928b3ef97 handle explicit null values in JSON 2016-05-23 16:44:30 -03:00
Jesse Wilson
bb451eac43 Merge pull request #832 from google/831
Ensuring that JsonAdapter annotation works correctly for primitive fi…
2016-05-17 17:26:52 -04:00
Inderjeet Singh
3ff16c30db Don't use a runtime wrapper if a JsonAdapter annotation is present on a field.
This ensures that JsonAdapter annotation works correctly on a primitive field.
This is a potentially backward incompatible change.
2016-05-17 13:30:59 -07:00
Jesse Wilson
ecda3582a6 Merge pull request #857 from google/jdk16_regression
Replaced a JDK 1.7 specific method with its JDK 1.6 equivalent.
2016-05-17 07:38:50 -04:00
Inderjeet Singh
61f83d6309 Replaced a JDK 1.7 specific method with its JDK 1.6 equivalent. 2016-05-17 01:03:00 -07:00
Jake Wharton
0f80936ecd Merge pull request #853 from Baschdl/patch-1
Corrected documentation, copy&paste error
2016-05-12 08:57:34 -07:00
Baschdl
c414b368e1 Corrected documentation, copy&paste error 2016-05-12 14:47:03 +02:00
Jake Wharton
c101e31c69 Merge pull request #848 from nthcircle/patch-1
Typo in the user guide.
2016-05-08 00:00:52 -04:00
Nth Circle
1bffde09ed Typo
Changed "Serialiers" to "Serializers"
2016-05-07 20:48:54 -07:00
Jesse Wilson
03337640c2 Merge pull request #840 from google/jw/on-deque
Switch default Queue implementation to ArrayDeque.
2016-04-27 00:40:58 -04:00
Jake Wharton
371aff7ce4 Switch default Queue implementation to ArrayDeque.
Now that we require Java 1.6 or newer this much more efficient implementation can be used as the default.
2016-04-27 00:37:28 -04:00
inder123
d590ca9087 Merge pull request #839 from google/jw/optimize
Optimize list allocation for every reflective field.
2016-04-26 21:32:02 -07:00
Jake Wharton
8537c8932f Optimize list allocation for every reflective field.
The common cases (no @SerializedName and a single-value @SerializedName) now use a specialized one-element collection. Cases with alternate names use a much more space efficient ArrayList which is exactly sized.

This is also a performance win for adapter initialization since an index-based loop was used on the returned type for which LinkedList is not suited for.
2016-04-27 00:28:51 -04:00
jwilson
d5c090835f Merge branch 'rharter-rh/config-props'
* rharter-rh/config-props:
  Adds getters for config fields.
2016-04-26 15:30:40 -04:00
Ryan Harter
a851569ab9 Adds getters for config fields.
This adds simple getters for certain config fields that would be helpful in custom
TypeAdapters to deal with situations like this:
https://github.com/rharter/auto-value-gson/issues/18
2016-04-26 15:30:01 -04:00
Jake Wharton
18f1795d18 Merge pull request #837 from zzz40500/patch-1
Documentation Error
2016-04-23 13:40:53 -04:00
zzz40500
71ee0e3759 Documentation Error
String anotherStr = gson.fromJson("[\"abc\"]", String.class); => String[] anotherStr = gson.fromJson("[\"abc\"]", String[].class);
2016-04-24 01:36:52 +08:00
Jesse Wilson
874e74a307 Merge pull request #836 from google/jw/boxed-boolean
Add boxed boolean value() overload.
2016-04-22 14:54:25 -10:00
Jake Wharton
59edfc1caf Add boxed boolean value() overload.
When calling value() with a Boolean overload resolution would choose value(boolean) which would throw an NPE on null. The other boxed types are all numbers which would resolve to value(Number) and behave correctly.
2016-04-22 19:52:38 -04:00
Jesse Wilson
0f66f4fac4 Merge pull request #829 from ionspin/master
Check if class can be instantiated based on class modifiers. Fix for #817
2016-04-22 06:47:08 -10:00
Ugljesa Jovanovic
ab40462cc7 Check if class can be instantiated based on class modifiers. If not throw an unsupported operation exception. 2016-04-20 10:43:34 +02:00