本文整理汇总了Java中org.codehaus.jackson.map.JsonDeserializer.deserializeWithType方法的典型用法代码示例。如果您正苦于以下问题:Java JsonDeserializer.deserializeWithType方法的具体用法?Java JsonDeserializer.deserializeWithType怎么用?Java JsonDeserializer.deserializeWithType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jackson.map.JsonDeserializer
的用法示例。
在下文中一共展示了JsonDeserializer.deserializeWithType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleNonArray
import org.codehaus.jackson.map.JsonDeserializer; //导入方法依赖的package包/类
private final Collection<Object> handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
throws IOException, JsonProcessingException
{
if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
throw paramDeserializationContext.mappingException(this._collectionType.getRawClass());
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
TypeDeserializer localTypeDeserializer = this._valueTypeDeserializer;
Object localObject;
if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
return paramCollection;
if (localTypeDeserializer == null)
{
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
continue;
}
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}
示例2: handleNonArray
import org.codehaus.jackson.map.JsonDeserializer; //导入方法依赖的package包/类
private final Collection<Object> handleNonArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
{
if (!paramDeserializationContext.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY))
throw paramDeserializationContext.mappingException(this._collectionType.getRawClass());
JsonDeserializer localJsonDeserializer = this._valueDeserializer;
TypeDeserializer localTypeDeserializer = this._valueTypeDeserializer;
Object localObject;
if (paramJsonParser.getCurrentToken() == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
return paramCollection;
if (localTypeDeserializer == null)
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
else
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}
示例3: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //导入方法依赖的package包/类
public Collection<Object> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
throws IOException, JsonProcessingException
{
if (!paramJsonParser.isExpectedStartArrayToken())
paramCollection = handleNonArray(paramJsonParser, paramDeserializationContext, paramCollection);
JsonDeserializer localJsonDeserializer;
TypeDeserializer localTypeDeserializer;
JsonToken localJsonToken;
do
{
return paramCollection;
localJsonDeserializer = this._valueDeserializer;
localTypeDeserializer = this._valueTypeDeserializer;
localJsonToken = paramJsonParser.nextToken();
}
while (localJsonToken == JsonToken.END_ARRAY);
Object localObject;
if (localJsonToken == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
break;
if (localTypeDeserializer == null)
{
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
continue;
}
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}
示例4: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //导入方法依赖的package包/类
@Override
public Collection<Object> deserialize(JsonParser jp, DeserializationContext ctxt,
Collection<Object> result)
throws IOException, JsonProcessingException
{
// Ok: must point to START_ARRAY
if (jp.getCurrentToken() != JsonToken.START_ARRAY) {
throw ctxt.mappingException(_collectionClass);
}
JsonDeserializer<Object> valueDes = _valueDeserializer;
JsonToken t;
final TypeDeserializer typeDeser = _valueTypeDeserializer;
while ((t = jp.nextToken()) != JsonToken.END_ARRAY) {
Object value;
if (t == JsonToken.VALUE_NULL) {
value = null;
} else if (typeDeser == null) {
value = valueDes.deserialize(jp, ctxt);
} else {
value = valueDes.deserializeWithType(jp, ctxt, typeDeser);
}
result.add(value);
}
return result;
}
示例5: deserialize
import org.codehaus.jackson.map.JsonDeserializer; //导入方法依赖的package包/类
public Collection<Object> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<Object> paramCollection)
{
if (!paramJsonParser.isExpectedStartArrayToken())
paramCollection = handleNonArray(paramJsonParser, paramDeserializationContext, paramCollection);
JsonDeserializer localJsonDeserializer;
TypeDeserializer localTypeDeserializer;
JsonToken localJsonToken;
do
{
return paramCollection;
localJsonDeserializer = this._valueDeserializer;
localTypeDeserializer = this._valueTypeDeserializer;
localJsonToken = paramJsonParser.nextToken();
}
while (localJsonToken == JsonToken.END_ARRAY);
Object localObject;
if (localJsonToken == JsonToken.VALUE_NULL)
localObject = null;
while (true)
{
paramCollection.add(localObject);
break;
if (localTypeDeserializer == null)
localObject = localJsonDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
else
localObject = localJsonDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
}
}