Commit Graph

2043 Commits

Author SHA1 Message Date
Inderjeet Singh
9b10e70a79 Removed the version numbers from the plugin configuration of pom.xmls. This ensures that the latest version of the plugins gets downloaded and used while building a project. 2010-10-25 23:09:24 +00:00
Inderjeet Singh
af6307a77f Implemented feedback from r607 2010-10-23 19:06:22 +00:00
Inderjeet Singh
6d9893ddf3 Added a transient map in Metadata since metadata is often of two kinds: transient and persistent. persistent part is serialized/deserialized to JSON. Fixed imports in RepositoryInMemory. 2010-10-23 15:45:33 +00:00
Inderjeet Singh
1d2648231f Revised the hashCode of Id to be based just on the value. Also, revised the equals method to return true when the only difference in the type is that one class is Foo and other is Foo<?, ?>. Added a compact toString() in the Id class that prints the type as MyType<Foo,Bar> instead of fully qualified names for each of the types.
Added tests regarding object equality for the Id class.
2010-10-23 15:34:57 +00:00
Inderjeet Singh
d3eda04f33 Added support for deserializing from null input to a null value.
Added toString() method to ObjectTypePair.
2010-10-22 16:06:59 +00:00
Inderjeet Singh
c01fd85adb Added toString() methods. 2010-10-22 15:12:05 +00:00
Inderjeet Singh
91bee2a688 Throwing JsonIOException on write failures 2010-10-18 23:58:09 +00:00
Inderjeet Singh
18a9205a04 Added an exception class to indicate IO Errors. 2010-10-18 23:54:09 +00:00
Inderjeet Singh
281ed6f866 Created a generalized key-value store,MetaDataMap, for a map of MetaData.
Moved MetaData to wsdef from wsf.
Added a Gson type adapter for Id type.
2010-10-18 15:45:35 +00:00
Inderjeet Singh
8cbdd8a030 simplified the equals method for CallPath 2010-10-17 16:04:07 +00:00
Inderjeet Singh
5adfa4bc04 Defined an interface RestResource that all resources need to extend from. Defined an Id class for a resource.
Changed a rest body spec to take a type instead of a class. This allows parameterized resource types.
Defined a repository interface with an in-memory implementation for server-side storage of rest resource instances.
2010-10-17 16:01:36 +00:00
Inderjeet Singh
6825477d75 Added a method to retrieve a Rest Response with a provided HTTP URL Connection. 2010-09-30 12:45:06 +00:00
Inderjeet Singh
ed415f692f Ensuring that the HTTP connection is closed when the rest call is finished. 2010-09-30 12:28:11 +00:00
Inderjeet Singh
1a4bea7334 removed redundant null checks.
Fixed bug in Streams.copy where it was not honoring the closeInput and closeOutput parameters. 
Suppressed spurious unused warnings
2010-09-28 15:04:02 +00:00
Inderjeet Singh
2b1f3eec15 Removed a bunch of unused code and unnecessary else statements. 2010-09-28 13:42:43 +00:00
Inderjeet Singh
e656954c16 removed spurious warnings and allowed extension of RestClient for creating testing fixtures. 2010-09-19 13:50:41 +00:00
Inderjeet Singh
9b0e7f8b84 initial check-in for implementing support for protocol buffers in Gson 2010-09-14 17:59:04 +00:00
Jesse Wilson
4c53c0640e Exhaustive test coverage for mixed streaming & binding. 2010-09-03 07:24:59 +00:00
Jesse Wilson
4e28bf3a39 Check in a passing test for issue 204. 2010-09-03 06:44:41 +00:00
Jesse Wilson
202bbfeef0 Fixing the Java 1.5 build. 2010-09-02 09:29:26 +00:00
Jesse Wilson
747e3c3051 Support mixed streaming and databinding with new APIs. 2010-09-02 00:15:23 +00:00
Jesse Wilson
ffdf0e7012 Fix some test problems.
JsonWriter was using suboptimal escape characters for newlines etc: unicode escapes rather than \x escapes.

JsonObjectTest was banning empty and whitespace-only keys. These values are permitted as of r585.
2010-09-02 00:10:26 +00:00
Jesse Wilson
fa40b4c63a Rename GsonReader to Streams; check that class in. 2010-09-02 00:10:02 +00:00
Jesse Wilson
78d1011ec5 Test escaping HTML characters! 2010-09-02 00:03:18 +00:00
Jesse Wilson
486820f515 Fix some test problems.
JsonWriter was using suboptimal escape characters for newlines etc: unicode escapes rather than \x escapes.

JsonObjectTest was banning empty and whitespace-only keys. These values are permitted as of r585.
2010-08-28 08:18:13 +00:00
Jesse Wilson
ff7aa3f331 Escape only the required characters when emitting JSON. This means that instead of emitting
["foo\nbar", "baz"]

we'll emit this:

  ["foo
bar", baz"]

This simple change measured about ~35% faster for in-memory writes!
2010-08-28 07:29:22 +00:00
Jesse Wilson
7e1e4eab07 Remove the constraint that map keys mustn't be the empty string.
See bug 227.
2010-08-28 05:02:33 +00:00
Jesse Wilson
69ecb9465a Test case demonstrating that issue 212 is fixed. We got comment parsing support for free when we switched to JsonReader. 2010-08-27 07:33:33 +00:00
Jesse Wilson
d5741b321f Don't exclude enum constants, even if they are anonymous.
See issue 226.
2010-08-27 07:26:35 +00:00
Jesse Wilson
eb7b1e4ac7 Test attempting (and failing) to reproduce issue 215. 2010-08-27 07:10:00 +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
Jesse Wilson
765a9f1ecd Brand new classes for streaming JSON efficiently.
Notable features:
 - Efficiency. The parser is faster than the current javacc parser. It's also faster than popular libraries for JSON streaming.
 - Toggle lenient/strict
 - Toggle pretty/compact
 - Friendly error messages on bad JSON
 - GSON-quality Javadoc
 - Non-execute prefix handling

This doesn't wire JsonReader up into Gson just yet. That's coming soon...
2010-08-26 08:44:02 +00:00
Joel Leitch
5bffa1f679 Fix for Issue 178. 2010-08-21 06:50:52 +00:00
Joel Leitch
3fc4bcc061 Minor test fixes. Explicitly fail test if the expected exception was not thrown. 2010-08-21 03:19:17 +00:00
Inderjeet Singh
de0f8da151 replaced unchecked suppressed warnings token with more specific rawtypes.
removed unused imports.
2010-08-20 16:27:46 +00:00
Inderjeet Singh
ed838ec104 replaced unchecked suppressed warnings token with more specific rawtypes 2010-08-20 16:20:37 +00:00
Jesse Wilson
bc5b836103 Test demonstrating a bug reported in issue 182, wherein malformed JSON is emitted when an property name contains a double-quote. 2010-08-20 05:45:51 +00:00
Jesse Wilson
8b5cc3256d Test demonstrating a bug reported in issue 178, wherein malformed JSON is emitted when a map key contains a double-quote. 2010-08-20 05:43:17 +00:00
Inderjeet Singh
cb6de44b56 Javadocs for Gson 1.5 2010-08-20 01:12:27 +00:00
Inderjeet Singh
24fd66f645 removed @since for non-public classes 2010-08-20 00:35:48 +00:00
Inderjeet Singh
dc60cb1931 Made FieldNamingStrategy2 is package protected class.
Made type hierarchy adapter registration package protected.
Marked some of the classes final.
Minor changes in the performance tests.
2010-08-19 00:10:42 +00:00
Joel Leitch
89c18452ae Ensure date with pattern is not override with the "default" date type adapter when a custom JsonSerializer/JsonDeserializer is registered. 2010-08-18 23:58:52 +00:00
Inderjeet Singh
01ce73441e Updated Gson version to 1.5 in maven configuration to match the current version. 2010-07-20 05:32:21 +00:00
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