當前位置: 首頁>>代碼示例>>Java>>正文


Java JsonDeserializer.deserializeWithType方法代碼示例

本文整理匯總了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);
  }
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:23,代碼來源:CollectionDeserializer.java

示例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);
  }
}
 
開發者ID:isnuryusuf,項目名稱:ingress-indonesia-dev,代碼行數:20,代碼來源:CollectionDeserializer.java

示例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);
  }
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:32,代碼來源:CollectionDeserializer.java

示例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;
}
 
開發者ID:r00li,項目名稱:RHome,代碼行數:29,代碼來源:CollectionDeserializer.java

示例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);
  }
}
 
開發者ID:isnuryusuf,項目名稱:ingress-indonesia-dev,代碼行數:29,代碼來源:CollectionDeserializer.java


注:本文中的org.codehaus.jackson.map.JsonDeserializer.deserializeWithType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。