当前位置: 首页>>代码示例>>Java>>正文


Java Deserializers类代码示例

本文整理汇总了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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:17,代码来源:OptionalHandlerFactory.java

示例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));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:Jackson2ObjectMapperBuilderTests.java

示例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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:34,代码来源:DeserializerFactoryConfig.java

示例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);
}
 
开发者ID:kubatatami,项目名称:JudoNetworking,代码行数:16,代码来源:EnumAnnotationModule.java

示例5: deserializers

import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
public Iterable<Deserializers> deserializers()
{
  return ArrayBuilders.arrayAsIterable(this._additionalDeserializers);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:DeserializerFactoryConfig.java

示例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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:7,代码来源:DeserializerFactoryConfig.java

示例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);
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:9,代码来源:Module.java

示例8: addDeserializers

import com.fasterxml.jackson.databind.deser.Deserializers; //导入依赖的package包/类
public abstract void addDeserializers(Deserializers paramDeserializers); 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:2,代码来源:Module.java


注:本文中的com.fasterxml.jackson.databind.deser.Deserializers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。