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