Search in sources :

Example 1 with StdSubtypeResolver

use of com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver in project jackson-databind by FasterXML.

the class ConfigObjectsTest method testSubtypeResolver.

public void testSubtypeResolver() throws Exception {
    ObjectMapper mapper = new ObjectMapper();
    SubtypeResolver res = mapper.getSubtypeResolver();
    assertTrue(res instanceof StdSubtypeResolver);
    StdSubtypeResolver repl = new StdSubtypeResolver();
    repl.registerSubtypes(Sub.class);
    mapper.setSubtypeResolver(repl);
    assertSame(repl, mapper.getSubtypeResolver());
}
Also used : SubtypeResolver(com.fasterxml.jackson.databind.jsontype.SubtypeResolver) StdSubtypeResolver(com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver) StdSubtypeResolver(com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver)

Aggregations

SubtypeResolver (com.fasterxml.jackson.databind.jsontype.SubtypeResolver)1 StdSubtypeResolver (com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver)1