Skip to content
Nicolas Morel edited this page Jun 28, 2014 · 1 revision

Since 0.6.0, you can now use mix-in annotations. To do so, you have 2 options : global and mapper specific.

Global configuration

Define your custom configuration in a class extending com.github.nmorel.gwtjackson.client.AbstractConfiguration. You can follow instructions on this page. Once settled, just call the method addMixInAnnotations to register your mix-in annotations.

public class MixInConfiguration extends AbstractConfiguration {

    @Override
    protected void configure() {
        addMixInAnnotations( EmptyBean.class, MixInForSimple.class );
    }
}

Mapper specific

If you need to define a mix-in annotation for a particular ObjectMapper, use the annotation com.github.nmorel.gwtjackson.client.annotation.JsonMixIns.

@JsonMixIns({@JsonMixIn(target = Beano.class, mixIn = BeanoMixinSub.class)})
public interface BeanoMapper extends ObjectMapper<Beano> {}
Clone this wiki locally