Commit Graph

300 Commits

Author SHA1 Message Date
Inderjeet Singh
08d3827dae Added methods with TypedKeys 2010-07-20 00:36:40 +00:00
Inderjeet Singh
8122deb364 fixed copyright notice, minor cosmetic changes. 2010-07-20 00:34:40 +00:00
Inderjeet Singh
425a59043d Added an example of a servlet class that uses Gson for web-service implementation. 2010-07-20 00:31:33 +00:00
Inderjeet Singh
c3f61ee5ad Added a test to reproduce bug described in http://groups.google.com/group/google-gson/browse_thread/thread/9591c539e3c19d59
Seems like an invalid bug report as Gson can deserialize primitive values in Integer fields.
2010-07-19 23:32:24 +00:00
Inderjeet Singh
341c4ce5d1 Added an example client to invoke example web-service
Update license files
2010-07-16 16:06:41 +00:00
Inderjeet Singh
8d24fe61f2 fixed the maven configuration file for relative paths 2010-07-13 21:59:35 +00:00
Inderjeet Singh
ceb2f8fdb0 A Web-service example 2010-07-13 21:47:37 +00:00
Inderjeet Singh
8bcbab629a Added an illustrative comment in the ParamMap precondition check. Added methods to take a formatted message in Preconditions. 2010-07-13 17:24:19 +00:00
Inderjeet Singh
58704f9aad removed the builder method that took String parameter name for better enforcement of type safety. 2010-07-13 17:16:47 +00:00
Inderjeet Singh
16c2832588 Made web-service client non-final to enable its mocks. 2010-07-12 23:10:58 +00:00
Inderjeet Singh
de74482fe8 Implemented hashCode and equals for TypedKey to make it a value object.
Asserted preconditions on constructor input.
2010-07-12 22:13:38 +00:00
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