All Projects → nmorel → Gwt Jackson

nmorel / Gwt Jackson

Licence: apache-2.0
gwt-jackson is a JSON parser for GWT. It uses Jackson 2.x annotations to customize the serialization/deserialization process.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Gwt Jackson

Bson4jackson
A pluggable BSON generator and parser for the Jackson JSON processor.
Stars: ✭ 244 (+121.82%)
Mutual labels:  json, jackson
Jslt
JSON query and transformation language
Stars: ✭ 367 (+233.64%)
Mutual labels:  json, jackson
Jackson Databind
General data-binding package for Jackson (2.x): works on streaming API (core) implementation(s)
Stars: ✭ 2,959 (+2590%)
Mutual labels:  json, jackson
Jackson Datatype Money
Extension module to properly support datatypes of javax.money
Stars: ✭ 165 (+50%)
Mutual labels:  json, jackson
Jsonj
A fluent Java API for manipulating json data structures
Stars: ✭ 42 (-61.82%)
Mutual labels:  json, jackson
Stubbornjava
Unconventional Java code for building web servers / services without a framework. Think dropwizard but as a seed project instead of a framework. If this project had a theme it would be break the rules but be mindful of your decisions.
Stars: ✭ 184 (+67.27%)
Mutual labels:  json, jackson
Jsonista
Clojure library for fast JSON encoding and decoding.
Stars: ✭ 290 (+163.64%)
Mutual labels:  json, jackson
Jackson Jq
jq for Jackson Java JSON Processor
Stars: ✭ 178 (+61.82%)
Mutual labels:  json, jackson
Jackson Module Kotlin
Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
Stars: ✭ 830 (+654.55%)
Mutual labels:  json, jackson
Typescript Generator
Generates TypeScript from Java - JSON declarations, REST service client
Stars: ✭ 729 (+562.73%)
Mutual labels:  json, jackson
Jackson Core
Core part of Jackson that defines Streaming API as well as basic shared abstractions
Stars: ✭ 2,003 (+1720.91%)
Mutual labels:  json, jackson
Emfjson Jackson
JSON Binding for Eclipse Modeling Framework
Stars: ✭ 79 (-28.18%)
Mutual labels:  json, jackson
Json Schema Validator
A fast Java JSON schema validator that supports draft V4, V6, V7 and V2019-09
Stars: ✭ 292 (+165.45%)
Mutual labels:  json, jackson
Jsonschema2pojo
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
Stars: ✭ 5,633 (+5020.91%)
Mutual labels:  json, jackson
Easyjson
Provides an unified JSON access API, you can adapter any JSON library to Gson, Jackson, FastJson with easyjson。 提供了一个JSON门面库,就像slf4j一样。easyjson本身不做json的操作,完全依赖于底层实现库。可以直接使用Easyjson的API,底层的JSON库随时可切换。也可以使用其中某个json的API,然后通过easyjson适配给其他的json库
Stars: ✭ 54 (-50.91%)
Mutual labels:  json, jackson
Kripton
A Java/Kotlin library for Android platform, to manage bean's persistence in SQLite, SharedPreferences, JSON, XML, Properties, Yaml, CBOR.
Stars: ✭ 110 (+0%)
Mutual labels:  json, jackson
Yq
Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
Stars: ✭ 1,688 (+1434.55%)
Mutual labels:  json
Killedbygoogle
Part guillotine, part graveyard for Google's doomed apps, services, and hardware.
Stars: ✭ 1,567 (+1324.55%)
Mutual labels:  json
Invoice As A Service
💰 Simple invoicing service (REST API): from JSON to PDF
Stars: ✭ 106 (-3.64%)
Mutual labels:  json
Render
Go package for easily rendering JSON, XML, binary data, and HTML templates responses.
Stars: ✭ 1,562 (+1320%)
Mutual labels:  json

gwt-jackson Build Status

gwt-jackson is a JSON parser for GWT. It uses Jackson 2.x annotations to customize the serialization/deserialization process.

Most of the Jackson 2.x annotations are supported. You can find an up-to-date list here. You can also find a lot of use cases in the tests.

Jackson 1.x annotations (org.codehaus.jackson.*) are not supported.

Check the wiki for more informations.

Quick start

Add <inherits name="com.github.nmorel.gwtjackson.GwtJackson" /> to your module descriptor XML file.

Then just create an interface extending ObjectReader, ObjectWriter or ObjectMapper if you want to read JSON, write an object to JSON or both.

Here's an example without annotation :

public class TestEntryPoint implements EntryPoint {

    public static interface PersonMapper extends ObjectMapper<Person> {}

    public static class Person {

        private String firstName;
        private String lastName;

        public String getFirstName() {
            return firstName;
        }

        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }

        public String getLastName() {
            return lastName;
        }

        public void setLastName(String lastName) {
            this.lastName = lastName;
        }
    }

    @Override
    public void onModuleLoad() {
        PersonMapper mapper = GWT.create( PersonMapper.class );

        String json = mapper.write( new Person( "John", "Doe" ) );
        GWT.log( json ); // > {"firstName":"John","lastName":"Doe"}

        Person person = mapper.read( json );
        GWT.log( person.getFirstName() + " " + person.getLastName() ); // > John Doe
    }
}

And if you want to make your class immutable for example, you can add some Jackson annotations :

public class TestEntryPoint implements EntryPoint {

    public static interface PersonMapper extends ObjectMapper<Person> {}

    public static class Person {

        private final String firstName;
        private final String lastName;

        @JsonCreator
        public Person( @JsonProperty( "firstName" ) String firstName,
                       @JsonProperty( "lastName" ) String lastName ) {
            this.firstName = firstName;
            this.lastName = lastName;
        }

        public String getFirstName() {
            return firstName;
        }

        public String getLastName() {
            return lastName;
        }
    }

    @Override
    public void onModuleLoad() {
        PersonMapper mapper = GWT.create( PersonMapper.class );

        String json = mapper.write( new Person( "John", "Doe" ) );
        GWT.log( json ); // > {"firstName":"John","lastName":"Doe"}

        Person person = mapper.read( json );
        GWT.log( person.getFirstName() + " " + person.getLastName() ); // > John Doe
    }
}

With Maven

<dependency>
  <groupId>com.github.nmorel.gwtjackson</groupId>
  <artifactId>gwt-jackson</artifactId>
  <version>0.15.4</version>
  <scope>provided</scope>
</dependency>

You can also get maven snapshots using the following repository :

<repository>
  <id>oss-sonatype-snapshots</id>
  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

Without Maven

In addition of gwt-jackson jar you can find here, you also need

Server communication

If you need to communicate with your server using REST/Json payload, you can check these framework which integrates gwt-jackson :

Copyright and license

Copyright 2014 Nicolas Morel under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].