public CustomObjectMapper() {
super.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
SimpleModule simpleModule = new SimpleModule("SimpleModule",
new Version(1, 0, 0, null));
simpleModule.addSerializer(new ContactSerializer());
simpleModule.addSerializer(new StructuredValueSerializer());
simpleModule.addSerializer(new TextListSerializer());
simpleModule.addSerializer(new TextSerializer());
simpleModule.addSerializer(new URIValueSerializer());
simpleModule.addSerializer(new DomainNameSerializer());
simpleModule.addSerializer(new DateTimeSerializer());
simpleModule.addSerializer(new StatusSerializer());
for (JsonSerializer serializer: getSerializers()) {
simpleModule.addSerializer(serializer);
}
simpleModule.addDeserializer(Contact.class, new ContactDeserializer());
simpleModule.addDeserializer(DomainName.class, new DomainNameDeserializer());
simpleModule.addDeserializer(Entity.Role.class, new RoleDeserializer());
simpleModule.addDeserializer(DateTime.class, new DateTimeDeserializer());
simpleModule.addDeserializer(Event.Action.class, new ActionDeserializer());
simpleModule.addDeserializer(Status.class, new StatusDeserializer());
simpleModule.addDeserializer(Domain.Variant.Relation.class, new RelationDeserializer());
registerModule(simpleModule);
}