本文整理汇总了Java中org.codehaus.jackson.map.deser.StdDeserializerProvider类的典型用法代码示例。如果您正苦于以下问题:Java StdDeserializerProvider类的具体用法?Java StdDeserializerProvider怎么用?Java StdDeserializerProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StdDeserializerProvider类属于org.codehaus.jackson.map.deser包,在下文中一共展示了StdDeserializerProvider类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: JsonSchemaSerializer
import org.codehaus.jackson.map.deser.StdDeserializerProvider; //导入依赖的package包/类
public JsonSchemaSerializer() {
objectMapper = new ObjectMapper();
SimpleDeserializers simpleDeserializers = new SimpleDeserializers();
simpleDeserializers.addDeserializer(String.class, new StringDeserializer());
objectMapper.setDeserializerProvider(
new StdDeserializerProvider().withAdditionalDeserializers(simpleDeserializers));
}
开发者ID:presidentio,项目名称:test-data-generator,代码行数:8,代码来源:JsonSchemaSerializer.java
示例2: setUp
import org.codehaus.jackson.map.deser.StdDeserializerProvider; //导入依赖的package包/类
@Before
public void setUp(){
mapper = new ObjectMapper();
SimpleDeserializers deserializers = new SimpleDeserializers();
deserializers.addDeserializer(Map.class, new StripeObjectDeserializer());
mapper.setDeserializerProvider(new StdDeserializerProvider().withAdditionalDeserializers(deserializers));
}
开发者ID:jlinn,项目名称:stripe-api-java,代码行数:8,代码来源:StripeObjectDeserializerTest.java
示例3: ObjectMapper
import org.codehaus.jackson.map.deser.StdDeserializerProvider; //导入依赖的package包/类
/**
*
* @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;
}
开发者ID:r00li,项目名称:RHome,代码行数:38,代码来源:ObjectMapper.java
示例4: createCustomMapper
import org.codehaus.jackson.map.deser.StdDeserializerProvider; //导入依赖的package包/类
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;
}
开发者ID:twitter,项目名称:hraven,代码行数:11,代码来源:ClientObjectMapper.java
示例5: toObjectMapper
import org.codehaus.jackson.map.deser.StdDeserializerProvider; //导入依赖的package包/类
public ObjectMapper toObjectMapper() {
final CustomDeserializerFactory factory = createFactory();
final DeserializerProvider deserializerProvider = new StdDeserializerProvider(factory);
final ObjectMapper mapper = new ObjectMapper();
mapper.setDeserializerProvider(deserializerProvider);
return mapper;
}
开发者ID:cerner,项目名称:jwala,代码行数:12,代码来源:JsonDeserializationBehavior.java
注:本文中的org.codehaus.jackson.map.deser.StdDeserializerProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论