本文整理汇总了Java中com.fasterxml.jackson.databind.deser.Deserializers类的典型用法代码示例。如果您正苦于以下问题:Java Deserializers类的具体用法?Java Deserializers怎么用?Java Deserializers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Deserializers类属于com.fasterxml.jackson.databind.deser包,在下文中一共展示了Deserializers类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findDeserializer
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
public JsonDeserializer<?> findDeserializer(JavaType paramJavaType, DeserializationConfig paramDeserializationConfig, BeanDescription paramBeanDescription)
{
Class localClass = paramJavaType.getRawClass();
if ((localClass.getName().startsWith("javax.xml.")) || (!hasSupertypeStartingWith(localClass, "javax.xml.")))
{
if (doesImplement(localClass, "org.w3c.dom.Node"))
return (JsonDeserializer)instantiate("com.fasterxml.jackson.databind.ext.DOMDeserializer$DocumentDeserializer");
if (doesImplement(localClass, "org.w3c.dom.Node"))
return (JsonDeserializer)instantiate("com.fasterxml.jackson.databind.ext.DOMDeserializer$NodeDeserializer");
return null;
}
Object localObject = instantiate("com.fasterxml.jackson.databind.ext.CoreXMLDeserializers");
if (localObject == null)
return null;
return ((Deserializers)localObject).findBeanDeserializer(paramJavaType, paramDeserializationConfig, paramBeanDescription);
}
示例2: deserializerByType
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
@Test
public void deserializerByType() throws JsonMappingException {
JsonDeserializer<Date> deserializer = new DateDeserializers.DateDeserializer();
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json()
.modules(new ArrayList<>()) // Disable well-known modules detection
.deserializerByType(Date.class, deserializer).build();
assertTrue(getDeserializerFactoryConfig(objectMapper).hasDeserializers());
Deserializers deserializers = getDeserializerFactoryConfig(objectMapper).deserializers().iterator().next();
assertSame(deserializer, deserializers.findBeanDeserializer(SimpleType.construct(Date.class), null, null));
}
示例3: DeserializerFactoryConfig
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
protected DeserializerFactoryConfig(Deserializers[] paramArrayOfDeserializers, KeyDeserializers[] paramArrayOfKeyDeserializers, BeanDeserializerModifier[] paramArrayOfBeanDeserializerModifier, AbstractTypeResolver[] paramArrayOfAbstractTypeResolver, ValueInstantiators[] paramArrayOfValueInstantiators)
{
Deserializers[] arrayOfDeserializers;
if (paramArrayOfDeserializers == null)
arrayOfDeserializers = NO_DESERIALIZERS;
else
arrayOfDeserializers = paramArrayOfDeserializers;
this._additionalDeserializers = arrayOfDeserializers;
KeyDeserializers[] arrayOfKeyDeserializers;
if (paramArrayOfKeyDeserializers == null)
arrayOfKeyDeserializers = DEFAULT_KEY_DESERIALIZERS;
else
arrayOfKeyDeserializers = paramArrayOfKeyDeserializers;
this._additionalKeyDeserializers = arrayOfKeyDeserializers;
BeanDeserializerModifier[] arrayOfBeanDeserializerModifier;
if (paramArrayOfBeanDeserializerModifier == null)
arrayOfBeanDeserializerModifier = NO_MODIFIERS;
else
arrayOfBeanDeserializerModifier = paramArrayOfBeanDeserializerModifier;
this._modifiers = arrayOfBeanDeserializerModifier;
AbstractTypeResolver[] arrayOfAbstractTypeResolver;
if (paramArrayOfAbstractTypeResolver == null)
arrayOfAbstractTypeResolver = NO_ABSTRACT_TYPE_RESOLVERS;
else
arrayOfAbstractTypeResolver = paramArrayOfAbstractTypeResolver;
this._abstractTypeResolvers = arrayOfAbstractTypeResolver;
ValueInstantiators[] arrayOfValueInstantiators;
if (paramArrayOfValueInstantiators == null)
arrayOfValueInstantiators = NO_VALUE_INSTANTIATORS;
else
arrayOfValueInstantiators = paramArrayOfValueInstantiators;
this._valueInstantiators = arrayOfValueInstantiators;
}
示例4: setupModule
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
@Override
public void setupModule(SetupContext context) {
super.setupModule(context);
Base deser = new Deserializers.Base() {
@SuppressWarnings("unchecked")
@Override
public JsonDeserializer<?> findEnumDeserializer(Class<?> type,
DeserializationConfig config, BeanDescription beanDesc)
throws JsonMappingException {
return new EnumAnnotationDeserializer((Class<Enum<?>>) type);
}
};
context.addDeserializers(deser);
}
示例5: deserializers
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
public Iterable<Deserializers> deserializers()
{
return ArrayBuilders.arrayAsIterable(this._additionalDeserializers);
}
示例6: withAdditionalDeserializers
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
public DeserializerFactoryConfig withAdditionalDeserializers(Deserializers paramDeserializers)
{
if (paramDeserializers == null)
throw new IllegalArgumentException("Can not pass null Deserializers");
return new DeserializerFactoryConfig((Deserializers[])ArrayBuilders.insertInListNoDup(this._additionalDeserializers, paramDeserializers), this._additionalKeyDeserializers, this._modifiers, this._abstractTypeResolvers, this._valueInstantiators);
}
示例7: addDeserializers
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
/**
* Method that module can use to register additional deserializers to use for
* handling types.
*
* @param d Object that can be called to find deserializer for types supported
* by module (null returned for non-supported types)
*/
public void addDeserializers(Deserializers d);
示例8: addDeserializers
import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
public abstract void addDeserializers(Deserializers paramDeserializers);