本文整理汇总了Java中com.fasterxml.jackson.databind.DeserializationConfig.constructType方法的典型用法代码示例。如果您正苦于以下问题:Java DeserializationConfig.constructType方法的具体用法?Java DeserializationConfig.constructType怎么用?Java DeserializationConfig.constructType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.DeserializationConfig
的用法示例。
在下文中一共展示了DeserializationConfig.constructType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findBeanDeserializer
import com.fasterxml.jackson.databind.DeserializationConfig; //导入方法依赖的package包/类
@Override
public JsonDeserializer<?> findBeanDeserializer( JavaType type, DeserializationConfig config,
BeanDescription beanDesc ) throws JsonMappingException {
final Class<?> raw = type.getRawClass();
if( MutableObject.class.isAssignableFrom( raw ) ) {
final Type[] actualTypeArguments = ( ( ParameterizedType ) raw.getGenericSuperclass() ).getActualTypeArguments();
final JavaType refType = config.constructType( ( Class ) actualTypeArguments[0] );
return new MutableObjectDeserializer( type, refType );
}
return super.findBeanDeserializer( type.getReferencedType(), config, beanDesc );
}
示例2: getFromObjectArguments
import com.fasterxml.jackson.databind.DeserializationConfig; //导入方法依赖的package包/类
public CreatorProperty[] getFromObjectArguments(DeserializationConfig paramDeserializationConfig)
{
JavaType localJavaType1 = paramDeserializationConfig.constructType(Integer.TYPE);
JavaType localJavaType2 = paramDeserializationConfig.constructType(Long.TYPE);
CreatorProperty[] arrayOfCreatorProperty = new CreatorProperty[5];
arrayOfCreatorProperty[0] = creatorProp("sourceRef", paramDeserializationConfig.constructType(Object.class), 0);
arrayOfCreatorProperty[1] = creatorProp("byteOffset", localJavaType2, 1);
arrayOfCreatorProperty[2] = creatorProp("charOffset", localJavaType2, 2);
arrayOfCreatorProperty[3] = creatorProp("lineNr", localJavaType1, 3);
arrayOfCreatorProperty[4] = creatorProp("columnNr", localJavaType1, 4);
return arrayOfCreatorProperty;
}