本文整理匯總了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;
}