Java 类org.codehaus.jackson.map.deser.StdDeserializerProvider 实例源码

项目:test-data-generator    文件:JsonSchemaSerializer.java   
public JsonSchemaSerializer() {
    objectMapper = new ObjectMapper();
    SimpleDeserializers simpleDeserializers = new SimpleDeserializers();
    simpleDeserializers.addDeserializer(String.class, new StringDeserializer());
    objectMapper.setDeserializerProvider(
            new StdDeserializerProvider().withAdditionalDeserializers(simpleDeserializers));
}
项目:stripe-api-java    文件:StripeObjectDeserializerTest.java   
@Before
public void setUp(){
    mapper = new ObjectMapper();
    SimpleDeserializers deserializers = new SimpleDeserializers();
    deserializers.addDeserializer(Map.class, new StripeObjectDeserializer());
    mapper.setDeserializerProvider(new StdDeserializerProvider().withAdditionalDeserializers(deserializers));
}
项目:RHome    文件:ObjectMapper.java   
/**
 * 
 * @param jf JsonFactory to use: if null, a new {@link MappingJsonFactory} will be constructed
 * @param sp SerializerProvider to use: if null, a {@link StdSerializerProvider} will be constructed
 * @param dp DeserializerProvider to use: if null, a {@link StdDeserializerProvider} will be constructed
 * @param sconfig Serialization configuration to use; if null, basic {@link SerializationConfig}
 *  will be constructed
 * @param dconfig Deserialization configuration to use; if null, basic {@link DeserializationConfig}
 *  will be constructed
 */
public ObjectMapper(JsonFactory jf,
                    SerializerProvider sp, DeserializerProvider dp,
                   SerializationConfig sconfig, DeserializationConfig dconfig)
{
    /* 02-Mar-2009, tatu: Important: we MUST default to using
     *   the mapping factory, otherwise tree serialization will
     *   have problems with POJONodes.
     * 03-Jan-2010, tatu: and obviously we also must pass 'this',
     *    to create actual linking.
     */
    _jsonFactory = (jf == null) ? new MappingJsonFactory(this) : jf;
    // visibility checker; usually default
    _visibilityChecker = STD_VISIBILITY_CHECKER;
    _serializationConfig = (sconfig != null) ? sconfig :
        new SerializationConfig(DEFAULT_INTROSPECTOR, DEFAULT_ANNOTATION_INTROSPECTOR, _visibilityChecker);
    _deserializationConfig = (dconfig != null) ? dconfig :
        new DeserializationConfig(DEFAULT_INTROSPECTOR, DEFAULT_ANNOTATION_INTROSPECTOR, _visibilityChecker);
    _serializerProvider = (sp == null) ? new StdSerializerProvider() : sp;
    _deserializerProvider = (dp == null) ? new StdDeserializerProvider() : dp;

    // Default serializer factory is stateless, can just assign
    _serializerFactory = BeanSerializerFactory.instance;

    // and use standard JsonNodeFactory initially
    _nodeFactory = JsonNodeFactory.instance;

}
项目:hraven    文件:ClientObjectMapper.java   
public static ObjectMapper createCustomMapper() {
  ObjectMapper result = new ObjectMapper();
  CustomDeserializerFactory deserializerFactory = new CustomDeserializerFactory();

  deserializerFactory.addSpecificMapping(Configuration.class, new ConfigurationDeserializer());
  deserializerFactory.addSpecificMapping(CounterMap.class, new CounterDeserializer());

  result.setDeserializerProvider(new StdDeserializerProvider(deserializerFactory));
  return result;
}
项目:jwala    文件:JsonDeserializationBehavior.java   
public ObjectMapper toObjectMapper() {

        final CustomDeserializerFactory factory = createFactory();

        final DeserializerProvider deserializerProvider = new StdDeserializerProvider(factory);

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

        return mapper;
    }