2.10.0.pr3:
ObjectMapper mapper = new ObjectMapper();
mapper.setDefaultTyping(new
DefaultTypeResolverBuilder(DefaultTyping.NON_FINAL, new
AllowTypeValidator()) {
@Override public boolean useForType(JavaType t) { return true; }}});
mapper.writeValueAsString(new Exception("Test")); // error
java.lang.IllegalStateException: Cannot build, 'init()' not yet called
at
com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.idResolver(StdTypeResolverBuilder.java:264)
So polymorphic serialisation can't be controlled, but by the 5
DefaultTyping strategies.
Thanks, Marc
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/1a2dfd53-9b21-49c3-bfff-21eefc9ac6c5%40googlegroups.com.