本文整理匯總了Java中org.codehaus.jackson.type.JavaType.isPrimitive方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaType.isPrimitive方法的具體用法?Java JavaType.isPrimitive怎麽用?Java JavaType.isPrimitive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.codehaus.jackson.type.JavaType
的用法示例。
在下文中一共展示了JavaType.isPrimitive方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isNaturalTypeWithStdHandling
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
protected boolean isNaturalTypeWithStdHandling(JavaType paramJavaType, JsonSerializer<?> paramJsonSerializer)
{
Class localClass = paramJavaType.getRawClass();
if (paramJavaType.isPrimitive())
if ((localClass == Integer.TYPE) || (localClass == Boolean.TYPE) || (localClass == Double.TYPE))
break label59;
label59:
do
do
return false;
while ((localClass != String.class) && (localClass != Integer.class) && (localClass != Boolean.class) && (localClass != Double.class));
while (paramJsonSerializer.getClass().getAnnotation(JacksonStdImpl.class) == null);
return true;
}
示例2: _reportIncompatibleRootType
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
protected void _reportIncompatibleRootType(Object paramObject, JavaType paramJavaType)
throws IOException, JsonProcessingException
{
if ((paramJavaType.isPrimitive()) && (ClassUtil.wrapperType(paramJavaType.getRawClass()).isAssignableFrom(paramObject.getClass())))
return;
throw new JsonMappingException("Incompatible types: declared root type (" + paramJavaType + ") vs " + paramObject.getClass().getName());
}
示例3: createArrayDeserializer
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
public JsonDeserializer<?> createArrayDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, ArrayType paramArrayType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
JavaType localJavaType = paramArrayType.getContentType();
JsonDeserializer localJsonDeserializer1 = (JsonDeserializer)localJavaType.getValueHandler();
if (localJsonDeserializer1 == null)
{
Object localObject = (JsonDeserializer)_arrayDeserializers.get(localJavaType);
if (localObject != null)
{
JsonDeserializer localJsonDeserializer3 = _findCustomArrayDeserializer(paramArrayType, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, null, null);
if (localJsonDeserializer3 != null)
localObject = localJsonDeserializer3;
return localObject;
}
if (localJavaType.isPrimitive())
throw new IllegalArgumentException("Internal error: primitive type (" + paramArrayType + ") passed, no array deserializer found");
}
TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType.getTypeHandler();
if (localTypeDeserializer == null)
localTypeDeserializer = findTypeDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
JsonDeserializer localJsonDeserializer2 = _findCustomArrayDeserializer(paramArrayType, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, localTypeDeserializer, localJsonDeserializer1);
if (localJsonDeserializer2 != null)
return localJsonDeserializer2;
if (localJsonDeserializer1 == null)
localJsonDeserializer1 = paramDeserializerProvider.findValueDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty);
return (JsonDeserializer<?>)new ArrayDeserializer(paramArrayType, localJsonDeserializer1, localTypeDeserializer);
}
示例4: NullProvider
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
protected NullProvider(JavaType paramJavaType, Object paramObject)
{
this._nullValue = paramObject;
this._isPrimitive = paramJavaType.isPrimitive();
this._rawType = paramJavaType.getRawClass();
}