org.codehaus.jackson.map.DeserializerProvider Java Examples

The following examples show how to use org.codehaus.jackson.map.DeserializerProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JsonDeserializationBehavior.java    From jwala with Apache License 2.0 3 votes vote down vote up
public ObjectMapper toObjectMapper() {

        final CustomDeserializerFactory factory = createFactory();

        final DeserializerProvider deserializerProvider = new StdDeserializerProvider(factory);

        final ObjectMapper mapper = new ObjectMapper();
        mapper.setDeserializerProvider(deserializerProvider);

        return mapper;
    }
 
Example #2
Source File: ObjectMapper_1_x_IT.java    From pinpoint with Apache License 2.0 2 votes vote down vote up
@Test
public void testConstructor() throws Exception {
    ObjectMapper mapper1 = new ObjectMapper();
    ObjectMapper mapper2 = new ObjectMapper(new JsonFactory());


    
    Constructor<?> omConstructor1 = ObjectMapper.class.getConstructor();
    Constructor<?> omConstructor2 = ObjectMapper.class.getConstructor(JsonFactory.class);
    Constructor<?> omConstructor3 = ObjectMapper.class.getConstructor(JsonFactory.class, SerializerProvider.class, DeserializerProvider.class);
    
    
    Class<?> serializationConfig = null;
    Class<?> deserializationConfig = null;
    
    try {
        serializationConfig = Class.forName("org.codehaus.jackson.map.SerializationConfig"); 
        deserializationConfig = Class.forName("org.codehaus.jackson.map.DeserializationConfig");
    } catch (ClassNotFoundException ignored) {
        
    }
    
    Constructor<?> omConstructor4 = null;
    
    if (serializationConfig != null && deserializationConfig != null) {
        omConstructor4 = ObjectMapper.class.getConstructor(JsonFactory.class, SerializerProvider.class, DeserializerProvider.class, serializationConfig, deserializationConfig);
    }
           

    PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
    verifier.printCache();

    
    if (omConstructor4 != null) {
        verifier.verifyTrace(event(SERVICE_TYPE, omConstructor4));
    }
    
    verifier.verifyTrace(event(SERVICE_TYPE, omConstructor3),
            event(SERVICE_TYPE, omConstructor1));
    
    if (omConstructor4 != null) {
        verifier.verifyTrace(event(SERVICE_TYPE, omConstructor4));
    }
    
    verifier.verifyTrace(event(SERVICE_TYPE, omConstructor3),
            event(SERVICE_TYPE, omConstructor2));

    verifier.verifyTraceCount(0);
}