当前位置: 首页>>代码示例>>Java>>正文


Java DeserializationContext.leaseObjectBuffer方法代码示例

本文整理汇总了Java中org.codehaus.jackson.map.DeserializationContext.leaseObjectBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java DeserializationContext.leaseObjectBuffer方法的具体用法?Java DeserializationContext.leaseObjectBuffer怎么用?Java DeserializationContext.leaseObjectBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.jackson.map.DeserializationContext的用法示例。


在下文中一共展示了DeserializationContext.leaseObjectBuffer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mapArray

import org.codehaus.jackson.map.DeserializationContext; //导入方法依赖的package包/类
protected List<Object> mapArray(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (paramJsonParser.nextToken() == JsonToken.END_ARRAY)
    return new ArrayList(4);
  ObjectBuffer localObjectBuffer = paramDeserializationContext.leaseObjectBuffer();
  Object[] arrayOfObject = localObjectBuffer.resetAndStart();
  int i = 0;
  int j = 0;
  while (true)
  {
    Object localObject = deserialize(paramJsonParser, paramDeserializationContext);
    j++;
    if (i >= arrayOfObject.length)
    {
      arrayOfObject = localObjectBuffer.appendCompletedChunk(arrayOfObject);
      i = 0;
    }
    int k = i + 1;
    arrayOfObject[i] = localObject;
    if (paramJsonParser.nextToken() == JsonToken.END_ARRAY)
    {
      ArrayList localArrayList = new ArrayList(1 + (j + (j >> 3)));
      localObjectBuffer.completeAndClearBuffer(arrayOfObject, k, localArrayList);
      return localArrayList;
    }
    i = k;
  }
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:30,代码来源:UntypedObjectDeserializer.java

示例2: deserialize

import org.codehaus.jackson.map.DeserializationContext; //导入方法依赖的package包/类
public String[] deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (!paramJsonParser.isExpectedStartArrayToken())
    return handleNonArray(paramJsonParser, paramDeserializationContext);
  ObjectBuffer localObjectBuffer = paramDeserializationContext.leaseObjectBuffer();
  Object[] arrayOfObject = localObjectBuffer.resetAndStart();
  int i = 0;
  JsonToken localJsonToken = paramJsonParser.nextToken();
  if (localJsonToken != JsonToken.END_ARRAY)
  {
    if (localJsonToken == JsonToken.VALUE_NULL);
    for (String str = null; ; str = paramJsonParser.getText())
    {
      if (i >= arrayOfObject.length)
      {
        arrayOfObject = localObjectBuffer.appendCompletedChunk(arrayOfObject);
        i = 0;
      }
      int j = i + 1;
      arrayOfObject[i] = str;
      i = j;
      break;
    }
  }
  String[] arrayOfString = (String[])localObjectBuffer.completeAndClearBuffer(arrayOfObject, i, String.class);
  paramDeserializationContext.returnObjectBuffer(localObjectBuffer);
  return arrayOfString;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:30,代码来源:ArrayDeserializers.java

示例3: deserialize

import org.codehaus.jackson.map.DeserializationContext; //导入方法依赖的package包/类
public Object[] deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (!paramJsonParser.isExpectedStartArrayToken())
    return handleNonArray(paramJsonParser, paramDeserializationContext);
  ObjectBuffer localObjectBuffer = paramDeserializationContext.leaseObjectBuffer();
  Object[] arrayOfObject1 = localObjectBuffer.resetAndStart();
  int i = 0;
  TypeDeserializer localTypeDeserializer = this._elementTypeDeserializer;
  JsonToken localJsonToken = paramJsonParser.nextToken();
  if (localJsonToken != JsonToken.END_ARRAY)
  {
    Object localObject;
    if (localJsonToken == JsonToken.VALUE_NULL)
      localObject = null;
    while (true)
    {
      if (i >= arrayOfObject1.length)
      {
        arrayOfObject1 = localObjectBuffer.appendCompletedChunk(arrayOfObject1);
        i = 0;
      }
      int j = i + 1;
      arrayOfObject1[i] = localObject;
      i = j;
      break;
      if (localTypeDeserializer == null)
      {
        localObject = this._elementDeserializer.deserialize(paramJsonParser, paramDeserializationContext);
        continue;
      }
      localObject = this._elementDeserializer.deserializeWithType(paramJsonParser, paramDeserializationContext, localTypeDeserializer);
    }
  }
  if (this._untyped);
  for (Object[] arrayOfObject2 = localObjectBuffer.completeAndClearBuffer(arrayOfObject1, i); ; arrayOfObject2 = localObjectBuffer.completeAndClearBuffer(arrayOfObject1, i, this._elementClass))
  {
    paramDeserializationContext.returnObjectBuffer(localObjectBuffer);
    return arrayOfObject2;
  }
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:42,代码来源:ArrayDeserializer.java


注:本文中的org.codehaus.jackson.map.DeserializationContext.leaseObjectBuffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。