当前位置: 首页>>代码示例>>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;未经允许,请勿转载。