@Test public void shouldRegisterSubtypesByName() throws JsonProcessingException { new ObjectMapperSubtypeConfigurer(true) .registerSubtype( mapper, new StringSubtypeLocator( "com.netflix.spinnaker.kork.jackson.RootType", searchPackages())); assertEquals("{\"kind\":\"child\"}", mapper.writeValueAsString(new ChildType())); }
public void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator) { subtypeLocator .searchPackages() .forEach(pkg -> mapper.registerSubtypes(findSubtypes(subtypeLocator.rootType(), pkg))); }
ObjectMapperSubtypeConfigurer { public void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator) { subtypeLocator .searchPackages() .forEach(pkg -> mapper.registerSubtypes(findSubtypes(subtypeLocator.rootType(), pkg))); } }
ObjectMapperSubtypeConfigurer { public void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator) { subtypeLocator .searchPackages() .forEach(pkg -> mapper.registerSubtypes(findSubtypes(subtypeLocator.rootType(), pkg))); } ObjectMapperSubtypeConfigurer(boolean strictSerialization); }
ObjectMapperSubtypeConfigurer { public void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator) { subtypeLocator .searchPackages() .forEach(pkg -> mapper.registerSubtypes(findSubtypes(subtypeLocator.rootType(), pkg))); } ObjectMapperSubtypeConfigurer(boolean strictSerialization); void registerSubtypes(ObjectMapper mapper, List<SubtypeLocator> subtypeLocators); void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator); }
ObjectMapperSubtypeConfigurer { public void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator) { subtypeLocator .searchPackages() .forEach(pkg -> mapper.registerSubtypes(findSubtypes(subtypeLocator.rootType(), pkg))); } ObjectMapperSubtypeConfigurer(boolean strictSerialization); void registerSubtypes(ObjectMapper mapper, List<SubtypeLocator> subtypeLocators); void registerSubtype(ObjectMapper mapper, SubtypeLocator subtypeLocator);  }