• Home
  • Raw
  • Download

Lines Matching +full:source +full:- +full:map +full:- +full:support

4 2. [Goals for Gson](#goals-for-gson)
5 3. [Gson Performance and Scalability](#gson-performance-and-scalability)
6 4. [Gson Users](#gson-users)
7 5. [Using Gson](#using-gson)
8 * [Using Gson with Gradle/Android](#using-gson-with-gradleandroid)
9 * [Using Gson with Maven](#using-gson-with-maven)
10 * [Primitives Examples](#primitives-examples)
11 * [Object Examples](#object-examples)
12 * [Finer Points with Objects](#finer-points-with-objects)
13 * [Nested Classes (including Inner Classes)](#nested-classes-including-inner-classes)
14 * [Array Examples](#array-examples)
15 * [Collections Examples](#collections-examples)
16 * [Collections Limitations](#collections-limitations)
17 * [Maps Examples](#maps-examples)
18 * [Serializing and Deserializing Generic Types](#serializing-and-deserializing-generic-types)
19 …on with Objects of Arbitrary Types](#serializing-and-deserializing-collection-with-objects-of-arbi…
20 * [Built-in Serializers and Deserializers](#built-in-serializers-and-deserializers)
21 * [Custom Serialization and Deserialization](#custom-serialization-and-deserialization)
22 * [Writing a Serializer](#writing-a-serializer)
23 * [Writing a Deserializer](#writing-a-deserializer)
24 * [Writing an Instance Creator](#writing-an-instance-creator)
25 * [InstanceCreator for a Parameterized Type](#instancecreator-for-a-parameterized-type)
26 …mpact Vs. Pretty Printing for JSON Output Format](#compact-vs-pretty-printing-for-json-output-form…
27 * [Null Object Support](#null-object-support)
28 * [Versioning Support](#versioning-support)
29 …ing Fields From Serialization and Deserialization](#excluding-fields-from-serialization-and-deseri…
30 * [Java Modifier Exclusion](#java-modifier-exclusion)
31 * [Gson's `@Expose`](#gsons-expose)
32 * [User Defined Exclusion Strategies](#user-defined-exclusion-strategies)
33 * [JSON Field Naming Support](#json-field-naming-support)
34 …tate Across Custom Serializers and Deserializers](#sharing-state-across-custom-serializers-and-des…
36 6. [Issues in Designing Gson](#issues-in-designing-gson)
37 7. [Future Enhancements to Gson](#future-enhancements-to-gson)
43 …son can work with arbitrary Java objects including pre-existing objects that you do not have sourc…
47 …echanisms like `toString()` and constructor (factory method) to convert Java to JSON and vice-versa
48 * Allow pre-existing unmodifiable objects to be converted to and from JSON
50 * Support arbitrarily complex objects
55 … we obtained on a desktop (dual opteron, 8GB RAM, 64-bit Ubuntu) running lots of other things alon…
89 <!-- Gson: Java to JSON conversion -->
129 // no-args constructor
165 …an **not** automatically deserialize the **pure inner classes since their no-args constructor also…
216 We also support multi-dimensional arrays, with arbitrarily complex element types.
230 // this is however not type-safe and care must be taken to specify the correct type for the local v…
245 …s any `java.util.Map` implementation as a JSON object. Because JSON objects only support strings a…
249 Map<String, String> stringMap = new LinkedHashMap<>();
251 stringMap.put(null, "null-entry");
254 String json = gson.toJson(stringMap); // ==> json is {"key":"value","null":"null-entry"}
256 Map<Integer, Integer> intMap = new LinkedHashMap<>();
264 …r the Map key type. Similar to the Collection example shown above, for deserialization a `TypeToke…
268 TypeToken<Map<String, String>> mapType = new TypeToken<Map<String, String>>(){};
273 // this is however not type-safe and care must be taken to specify the correct type for the local v…
274 Map<String, String> stringMap = gson.fromJson(json, mapType);
278Map keys. This feature can be enabled with [`GsonBuilder.enableComplexMapKeySerialization()`](http…
294 Map<PersonName, Integer> complexMap = new LinkedHashMap<>();
298 // Serialization; complex map is serialized as a JSON array containing key-value pairs (as JSON arr…
302 Map<String, String> stringMap = new LinkedHashMap<>();
304 // Serialization; non-complex map is serialized as a regular JSON object
308Map keys, this can lead to malformed encoded keys or can cause mismatch between serialization and …
310 Note that when deserializing enums as Map keys, if Gson is unable to find an enum constant with a m…
314 …romJson(json, MyClass.class)` method. This works fine if the object is a non-generic type. However…
343 `['hello',5,{name:'GREETINGS',source:'guest'}]`
359 private String source;
360 private Event(String name, String source) {
362 this.source = source;
369 …, Collection.class)` will not work since Gson has no way of knowing how to map the input to the ty…
371 1. Use Gson's parser API (low-level streaming parser or the DOM parser JsonParser) to parse the arr…
377 This approach is practical only if the array appears as a top-level element or if you can change th…
379 ### Built-in Serializers and Deserializers
381 Gson has built-in serializers and deserializers for commonly used classes whose default representat…
388 …d source code for some commonly used classes such as JodaTime at [this page](https://sites.google.…
398 * Instance Creators: Not needed if no-args constructor is available or a deserializer is registered
455 Well-behaved classes that are meant for serialization and deserialization should have a no-argument…
459 …are needed when you are dealing with a library class that does NOT define a no-argument constructor
518 …luded in collections/arrays of objects). See the [Null Object Support](#null-object-support) secti…
529 ### Null Object Support
574 ### Versioning Support
612-level classes, fields and field types. Below are pluggable mechanisms that allow field and class …
641 … to exclude fields marked with a specific `@Foo` annotation and excludes top-level types (or decla…
696 ### JSON Field Naming Support
698-defined field naming policies to convert the standard Java field names (i.e., camel cased names s…
727 … naming policy ([see this discussion](https://groups.google.com/group/google-gson/browse_thread/th…
731 …/deserializers ([see this discussion](https://groups.google.com/group/google-gson/browse_thread/th…
737 1 and 2 are not thread-safe options, but 3 is.