Commit Graph

289 Commits

Author SHA1 Message Date
Inderjeet Singh
b2af57d288 Added checks to ensure that typeHierarchyAdapter being registered doesn't hide a previously existing one.
Fixed a bug where registerIfAbsent was adding type adapters in the reverse order of priority.
Added toString() to Pair.
2010-06-24 21:51:18 +00:00
Inderjeet Singh
8aedbc84db Added a new GsonBuilder option to register a type adapter for a type hierarchy instead of a single type.
Upgraded Gson version to 1.5 since a new API call is being added.
2010-06-21 23:26:06 +00:00
Inderjeet Singh
6728c742d2 Updated log statements to be localizable. 2010-06-15 20:40:12 +00:00
Joel Leitch
9cd72ca7fb Add new tests with SerializedName annotation that contains a space in the name. 2010-05-28 02:13:11 +00:00
Joel Leitch
855a79a0f0 Stop generating the Parser class on mvn:compile or mvn:package. 2010-05-28 02:11:38 +00:00
Joel Leitch
ba0154867d Add support to allow spaces in the JSON field name. 2010-05-26 17:40:19 +00:00
Joel Leitch
389f918bb8 Add new performance test for large objects (many fields). 2010-05-19 21:29:58 +00:00
Joel Leitch
9c7bfc677a Allow cache size to be configured. 2010-05-19 20:47:27 +00:00
Joel Leitch
2610a2920d Update Parser to add members to an JsonObject within a loop rather than a recursive call. 2010-05-19 20:44:27 +00:00
Inderjeet Singh
e7e2e59f73 added missing put methods with TypedKey 2010-04-21 00:02:25 +00:00
Inderjeet Singh
00b5d77fa6 Revised methods using TypedKey to use the class contained in the TypedKey instead of explicitly asking for it as a method parameter. 2010-04-20 22:45:48 +00:00
Inderjeet Singh
d46fea80db added type cast to fix JDK version mismatch issue 2010-04-03 05:53:11 +00:00
Inderjeet Singh
7a115785b7 Added a getHeader method with a TypedKey in RestRequest. 2010-03-15 13:12:27 +00:00
Inderjeet Singh
d8638badf3 updated Google collections to the latest version 2010-02-16 14:02:42 +00:00
Inderjeet Singh
ad0e0d6f54 Added means to define and implement REST web-service and its clients.
Added missing copyright headers.
Added TypedKey based methods in request/response classes.
2010-02-15 23:24:48 +00:00
Inderjeet Singh
1925fb966c Introduced the notion of TypedKey for a parameter map or spec 2010-02-15 14:46:42 +00:00
Inderjeet Singh
9c8e8bd77e added ability to specify a Gson instance for use in getting a response. 2010-02-03 05:07:52 +00:00
Inderjeet Singh
f300cf35a2 removed Google collections and guice as dependencies 2010-02-02 14:02:35 +00:00
Inderjeet Singh
ef30498833 removed Google collections and guice as dependencies 2010-02-02 14:02:21 +00:00
Inderjeet Singh
a7e3971fdd Added setting of content-length in requests even if the body is non existent.
Fixed logs for requests.
Ensured that streams are not inadvertently closed while copying output.
2010-01-26 14:18:19 +00:00
Inderjeet Singh
dbca5571e0 Added Content-Length to each request that goes out.
If a web-service request fails, we try to log as much response as possible.
2010-01-24 15:02:17 +00:00
Inderjeet Singh
e4e9254034 Added an asynchronous client for invoking Web-services. This client uses a queue to hold web-service requests and returns the control back to the caller. A separate thread executes these web-service requests and invokes a caller-suplied callback with the results.
Made WebServiceClient reusable across different type of Web-service calls.
Added configurable logging support in RequestSender, ResponseReceiver and WebServiceClients. Added some logging.
Throwing WebServiceSystemException instead of RuntimException.
2010-01-20 13:59:59 +00:00
Inderjeet Singh
0a134db2f0 Added a new interface ResponseBuilder that is implemented by handlers to build a response of a specific type.
ResponseSender now sets the content-type of the stream to application/json
2010-01-20 13:53:53 +00:00
Inderjeet Singh
e5c89f1ebc Added a precondition check to ensure that a parameter being added to a ParamMap is compatible with its spec.
Added comments in RequestBody and ResponseBody to indicate that their Gson type adapters must be used.
2010-01-20 13:52:22 +00:00
Inderjeet Singh
51efca8457 Removed dependence on Guice and Collections from wsclient.
Renamed Builder.create() methods to Builder.build()
2010-01-19 12:58:52 +00:00
Inderjeet Singh
2bcc832ade removed dependence on Google Guice and Google Collections libraries 2010-01-19 12:47:11 +00:00
Joel Leitch
bf2a0e4e0b Adding tests to ensure the adapter from the old to new naming strategy is working properly. 2010-01-10 03:27:59 +00:00
Joel Leitch
9816426bba Add new Cache interface and LRU Cache implementation to cache field annotations per "Class" (rather than per instance). This results in a significant speed-up (approx. 3X) when serializing/deserializing the same classes over and over again. 2010-01-10 00:32:21 +00:00
Joel Leitch
e6496fddd6 Update JavaDoc to link to the correct interface (FieldNamingStrategy2). 2010-01-09 22:48:53 +00:00
Joel Leitch
e3af076ff2 Deprecate the FieldNamingStrategy interface and replace it with FieldNamingStrategy2. This is the first step to help make it easy to cache field annotations across all instances of a class, etc. 2010-01-09 22:43:27 +00:00
Inderjeet Singh
7079799890 Fixed issue 167 by adding support for TreeSet deserialization. Added tests for serialization/deserialization of treesets. 2010-01-08 19:14:42 +00:00
Inderjeet Singh
058f7344db Revised the setup for date/time tests to use PST time-zone. This fixes bug 184 by ensuring that tests are run in PST time-zone. 2010-01-08 18:53:39 +00:00
Inderjeet Singh
c5e3c32215 Added missing class 2009-12-28 10:17:40 +00:00
Inderjeet Singh
45bf2db854 Created new projects:
1. wsdef: contains classes that are used to define a Gson based JSON web service
2. wsclient: contains classes that are used to write a Gson based web-service client

wsf is now only a server-side framework. Moved classes relevant for wsdef and wsclient from it to the individual projects.
2009-12-28 09:44:47 +00:00
Inderjeet Singh
15fa10943c Fixed serializers and deserializers for java.sql Date and Time to ensure that Date does't serialize time, and time does't serialize the date portion. 2009-12-04 18:15:00 +00:00
Inderjeet Singh
ebf24fbda5 Fixed issue 134 by adding support for java.sql Date and Timestamp classses. 2009-12-04 01:21:13 +00:00
Joel Leitch
c329d020b9 Make some fields final and initialize immediately. 2009-12-03 23:13:39 +00:00
Joel Leitch
33e816dcf0 More lazy initialization done for FieldAttributes. 2009-12-03 22:28:58 +00:00
Joel Leitch
641390b1a1 Lazily initialize fields in FieldAttributes to prevent multiple Java reflection invocations. 2009-12-03 22:17:39 +00:00
Inderjeet Singh
610580b8d9 exposed final fields of Pair for fast access. Pair is used quite a bit during serialization because of its use in ref stack. 2009-12-03 20:58:22 +00:00
Inderjeet Singh
fff9147988 Added some tests to measure serialization and deserialization performance of Gson based on the discussion in http://groups.google.com/group/google-gson/browse_thread/thread/7a50b17a390dfaeb
Surprising just marking a field as exposed halves the performance.
2009-10-20 00:04:34 +00:00
Joel Leitch
015d2016c5 Last JavaDoc Update missed adding the new files. 2009-10-09 23:55:54 +00:00
Joel Leitch
be2631e835 Updating JavaDocs 2009-10-09 23:49:13 +00:00
Joel Leitch
102f8b3a71 Adding a few more assert to the InstanceCreatorTest to ensure that the default values are set for sub class fields. 2009-10-09 21:23:51 +00:00
Joel Leitch
d87d3f807f Added functional tests for user defined exclusion strategy.
Added test to ensure empty/null properties are added for the JsonObject.
2009-10-09 21:12:07 +00:00
Inderjeet Singh
bc1e5c5c99 Ensured that custom deserializer is invoked with actual type returned for field values.
Fixed a bug where a top-level object was constructed with default values even when the custom deserializer tried to set it to null.
2009-10-09 19:41:33 +00:00
Inderjeet Singh
338758a0d3 implemented support for deserialization to deserialize to more specific type if an instance creator returns a sub-class. 2009-10-09 18:16:16 +00:00
Joel Leitch
fffb204cee Removed import for java.util.Map.Entry. 2009-10-09 18:10:43 +00:00
Joel Leitch
de6af4411b Minor fixes. 2009-10-09 15:43:50 +00:00
Inderjeet Singh
60ef777efc Fixed custom serilization invocation to correctly handle nulls returned by custom serializer. 2009-10-09 15:28:05 +00:00