{"id":21444888,"url":"https://github.com/nmorel/gwt-jackson","last_synced_at":"2025-07-14T18:31:54.692Z","repository":{"id":10237749,"uuid":"12341002","full_name":"nmorel/gwt-jackson","owner":"nmorel","description":"gwt-jackson is a JSON parser for GWT. It uses Jackson 2.x annotations to customize the serialization/deserialization process.","archived":false,"fork":false,"pushed_at":"2022-07-15T21:05:14.000Z","size":2221,"stargazers_count":112,"open_issues_count":34,"forks_count":52,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-01-09T11:10:23.364Z","etag":null,"topics":["gwt","jackson","json"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmorel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-24T09:24:43.000Z","updated_at":"2024-01-09T11:10:23.365Z","dependencies_parsed_at":"2022-08-20T13:30:45.172Z","dependency_job_id":null,"html_url":"https://github.com/nmorel/gwt-jackson","commit_stats":null,"previous_names":[],"tags_count":25,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmorel%2Fgwt-jackson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmorel%2Fgwt-jackson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmorel%2Fgwt-jackson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmorel%2Fgwt-jackson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmorel","download_url":"https://codeload.github.com/nmorel/gwt-jackson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225991829,"owners_count":17556371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gwt","jackson","json"],"created_at":"2024-11-23T02:22:07.807Z","updated_at":"2024-11-23T02:22:16.023Z","avatar_url":"https://github.com/nmorel.png","language":"Java","funding_links":[],"categories":["Jackson Library"],"sub_categories":[],"readme":"gwt-jackson [![Build Status](https://travis-ci.org/nmorel/gwt-jackson.svg?branch=master)](https://travis-ci.org/nmorel/gwt-jackson)\n=====\ngwt-jackson is a JSON parser for [GWT](http://www.gwtproject.org/). It uses [Jackson 2.x annotations](https://github.com/FasterXML/jackson-annotations) to customize the serialization/deserialization process.\n\nMost of the [Jackson 2.x annotations](https://github.com/FasterXML/jackson-annotations) are supported. You can find an up-to-date list [here](https://github.com/nmorel/gwt-jackson/wiki/Jackson-annotations-support).\nYou can also find a lot of use cases in the [tests](gwt-jackson/src/test/java/com/github/nmorel/gwtjackson).\n\nJackson 1.x annotations (`org.codehaus.jackson.*`) are not supported.\n\nCheck the [wiki](https://github.com/nmorel/gwt-jackson/wiki) for more informations.\n\nQuick start\n-------------\nAdd `\u003cinherits name=\"com.github.nmorel.gwtjackson.GwtJackson\" /\u003e` to your module descriptor XML file.\n\nThen just create an interface extending `ObjectReader`, `ObjectWriter` or `ObjectMapper` if you want to read JSON, write an object to JSON or both.\n\nHere's an example without annotation :\n\n```java\npublic class TestEntryPoint implements EntryPoint {\n\n    public static interface PersonMapper extends ObjectMapper\u003cPerson\u003e {}\n\n    public static class Person {\n\n        private String firstName;\n        private String lastName;\n\n        public String getFirstName() {\n            return firstName;\n        }\n\n        public void setFirstName(String firstName) {\n            this.firstName = firstName;\n        }\n\n        public String getLastName() {\n            return lastName;\n        }\n\n        public void setLastName(String lastName) {\n            this.lastName = lastName;\n        }\n    }\n\n    @Override\n    public void onModuleLoad() {\n        PersonMapper mapper = GWT.create( PersonMapper.class );\n\n        String json = mapper.write( new Person( \"John\", \"Doe\" ) );\n        GWT.log( json ); // \u003e {\"firstName\":\"John\",\"lastName\":\"Doe\"}\n\n        Person person = mapper.read( json );\n        GWT.log( person.getFirstName() + \" \" + person.getLastName() ); // \u003e John Doe\n    }\n}\n```\n\nAnd if you want to make your class immutable for example, you can add some Jackson annotations :\n\n```java\npublic class TestEntryPoint implements EntryPoint {\n\n    public static interface PersonMapper extends ObjectMapper\u003cPerson\u003e {}\n\n    public static class Person {\n\n        private final String firstName;\n        private final String lastName;\n\n        @JsonCreator\n        public Person( @JsonProperty( \"firstName\" ) String firstName,\n                       @JsonProperty( \"lastName\" ) String lastName ) {\n            this.firstName = firstName;\n            this.lastName = lastName;\n        }\n\n        public String getFirstName() {\n            return firstName;\n        }\n\n        public String getLastName() {\n            return lastName;\n        }\n    }\n\n    @Override\n    public void onModuleLoad() {\n        PersonMapper mapper = GWT.create( PersonMapper.class );\n\n        String json = mapper.write( new Person( \"John\", \"Doe\" ) );\n        GWT.log( json ); // \u003e {\"firstName\":\"John\",\"lastName\":\"Doe\"}\n\n        Person person = mapper.read( json );\n        GWT.log( person.getFirstName() + \" \" + person.getLastName() ); // \u003e John Doe\n    }\n}\n```\n\nWith Maven\n-------------\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.nmorel.gwtjackson\u003c/groupId\u003e\n  \u003cartifactId\u003egwt-jackson\u003c/artifactId\u003e\n  \u003cversion\u003e0.15.4\u003c/version\u003e\n  \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nYou can also get maven snapshots using the following repository :\n\n```xml\n\u003crepository\u003e\n  \u003cid\u003eoss-sonatype-snapshots\u003c/id\u003e\n  \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n  \u003csnapshots\u003e\n    \u003cenabled\u003etrue\u003c/enabled\u003e\n  \u003c/snapshots\u003e\n\u003c/repository\u003e\n```\n\nWithout Maven\n-------------\nIn addition of gwt-jackson jar you can find [here](https://github.com/nmorel/gwt-jackson/releases), you also need\n- [jackson-annotations-2.7.2.jar](http://search.maven.org/remotecontent?filepath=com/fasterxml/jackson/core/jackson-annotations/2.7.2/jackson-annotations-2.7.2.jar)\n- [jackson-annotations-2.7.2-sources.jar](http://search.maven.org/remotecontent?filepath=com/fasterxml/jackson/core/jackson-annotations/2.7.2/jackson-annotations-2.7.2-sources.jar) for the GWT compilation only\n- [javapoet-1.0.0.jar](http://search.maven.org/remotecontent?filepath=com/squareup/javapoet/1.0.0/javapoet-1.0.0.jar) for the GWT compilation only\n\nServer communication\n-------------\nIf you need to communicate with your server using REST/Json payload, you can check these framework which integrates gwt-jackson :\n- [GWTP Rest Dispatch](http://dev.arcbees.com/gwtp/communication/index.html). Check the [example](https://github.com/nmorel/gwt-jackson/tree/master/examples/gwtp).\n- [RestyGWT](http://resty-gwt.github.io/). Check the [example](https://github.com/nmorel/gwt-jackson/tree/master/examples/restygwt).\n- [Requestor](http://reinert.io/requestor/latest/). Check the [example](https://github.com/nmorel/gwt-jackson/tree/master/examples/requestor).\n- [gwt-jackson-rest](https://github.com/nmorel/gwt-jackson-rest). Check the [example](https://github.com/nmorel/gwt-jackson-rest/tree/master/examples/simple).\n- [GWT RequestBuilder](http://www.gwtproject.org/javadoc/latest/com/google/gwt/http/client/RequestBuilder.html). Check the [example](https://github.com/nmorel/gwt-jackson/tree/master/examples/hello).\n\nCopyright and license\n-------------\n\nCopyright 2014 Nicolas Morel under the [Apache 2.0 license](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmorel%2Fgwt-jackson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmorel%2Fgwt-jackson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmorel%2Fgwt-jackson/lists"}