Commit Graph

24 Commits

Author SHA1 Message Date
Joel Leitch
e345feb438 Comments from r821 2011-04-14 18:54:09 +00:00
Joel Leitch
c894fb6c23 Default support for BitSet. As well, provide more flexibility on getAsBoolean for a JsonPrimitive. 2011-04-14 02:42:47 +00:00
Inderjeet Singh
c8bd121db2 Renamed $Preconditions to $Gson$Preconditions and $Types to $Gson$Types.
Marked the two private classes in $Types as final.
2011-04-06 00:26:57 +00:00
Inderjeet Singh
feb9617bf0 Incorporated comments from r726 2011-04-04 22:09:51 +00:00
Jesse Wilson
4efb133b4a bling bling
Prefix internal classes with $ to prevent them from interfering with IDE's auto import functionality.
2011-03-29 21:24:26 +00:00
Joel Leitch
861e047a62 Create an "internals" package for classes that we do not want to share, but is needed across multiple pacakges.
As well, move non-Gson specific classes, such as Preconditions, to this new "internals" package.
2011-03-21 22:30:35 +00:00
Inderjeet Singh
28567508ea Corrected Javadocs to indicate that NumberFormatException gets thrown instead of ClassCastException while attempting to convert a JsonPrimitive to a number. 2011-03-11 00:14:49 +00:00
Jesse Wilson
3d006c90a2 equals & hashCode for subclasses of JsonElement.
Resolves issue 64.
2011-02-15 00:14:20 +00:00
Inderjeet Singh
2b1f3eec15 Removed a bunch of unused code and unnecessary else statements. 2010-09-28 13:42:43 +00:00
Jesse Wilson
7a7bbf754c Use JsonReader internally rather than JsonParserJavacc.
For raw parsing (ie. new JsonParser().parse()) the parse time has improved substantially. For example, JsonParserJavacc parsed my 48KiB buzz feed in 4.8ms. JsonReader parses the same feed in 0.9ms.

http://microbenchmarks.appspot.com/run/limpbizkit@gmail.com/com.google.gson.GsonBenchmark/430001
2010-08-27 05:59:18 +00:00
Joel Leitch
93b0008486 Adding restrictions on the JsonElements to disallow Java "null"s. 2009-10-08 22:03:08 +00:00
Inderjeet Singh
fdcd3945c5 Fixed issue 147.
Integral values (byte, short, integer, long, BigInteger) are now comparable to each other.
Floating point values (float, double, BigDecimal) are now comparable to each other.
2009-09-23 18:54:01 +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
c13fc568c7 Fixed indentation and simplified equals method as per code review comments on r419 2009-08-18 18:07:25 +00:00
Inderjeet Singh
64172d1dac Added support to serialize and deserialize array of java.lang.Object when the content is a primitive type. 2009-07-27 23:24:23 +00:00
Inderjeet Singh
f418ab69a2 Implementing hashcode and equals for JsonPrimitives as value type equality. 2009-04-03 21:24:38 +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
ea79cd6812 Allow booleans and number to be deserialized into a "String" field/object. 2008-12-14 04:42:16 +00:00
Joel Leitch
5ae7e1f803 Adding new convenience method to JsonObject for adding Booleans and Characters. 2008-11-30 23:36:29 +00:00
Joel Leitch
b506183d94 Move isPrimitiveOrString() method from ObjectNavigator to JsonPrimitive. 2008-11-27 00:40:31 +00:00
Joel Leitch
0c98c2f8d1 More lenient parsing of Numbers and Booleans. Basically, can deserialize properly formatted stringr representations of numbers and booleans. 2008-11-20 19:40:12 +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