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


Java JsonParser.isExpectedStartArrayToken方法代碼示例

本文整理匯總了Java中org.codehaus.jackson.JsonParser.isExpectedStartArrayToken方法的典型用法代碼示例。如果您正苦於以下問題:Java JsonParser.isExpectedStartArrayToken方法的具體用法?Java JsonParser.isExpectedStartArrayToken怎麽用?Java JsonParser.isExpectedStartArrayToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.codehaus.jackson.JsonParser的用法示例。


在下文中一共展示了JsonParser.isExpectedStartArrayToken方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
public EnumSet<?> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (!paramJsonParser.isExpectedStartArrayToken())
    throw paramDeserializationContext.mappingException(EnumSet.class);
  EnumSet localEnumSet = constructSet();
  while (true)
  {
    JsonToken localJsonToken = paramJsonParser.nextToken();
    if (localJsonToken == JsonToken.END_ARRAY)
      break;
    if (localJsonToken == JsonToken.VALUE_NULL)
      throw paramDeserializationContext.mappingException(this._enumClass);
    localEnumSet.add(this._enumDeserializer.deserialize(paramJsonParser, paramDeserializationContext));
  }
  return localEnumSet;
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:18,代碼來源:EnumSetDeserializer.java

示例2: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
public Collection<String> deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, Collection<String> paramCollection)
  throws IOException, JsonProcessingException
{
  if (!paramJsonParser.isExpectedStartArrayToken())
    paramCollection = handleNonArray(paramJsonParser, paramDeserializationContext, paramCollection);
  JsonToken localJsonToken;
  do
  {
    return paramCollection;
    if (!this._isDefaultDeserializer)
      return deserializeUsingCustom(paramJsonParser, paramDeserializationContext, paramCollection);
    localJsonToken = paramJsonParser.nextToken();
  }
  while (localJsonToken == JsonToken.END_ARRAY);
  if (localJsonToken == JsonToken.VALUE_NULL);
  for (Object localObject = null; ; localObject = paramJsonParser.getText())
  {
    paramCollection.add(localObject);
    break;
  }
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:22,代碼來源:StringCollectionDeserializer.java

示例3: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
public boolean[] deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (!paramJsonParser.isExpectedStartArrayToken())
    return handleNonArray(paramJsonParser, paramDeserializationContext);
  ArrayBuilders.BooleanBuilder localBooleanBuilder = paramDeserializationContext.getArrayBuilders().getBooleanBuilder();
  boolean[] arrayOfBoolean = (boolean[])localBooleanBuilder.resetAndStart();
  int j;
  for (int i = 0; paramJsonParser.nextToken() != JsonToken.END_ARRAY; i = j)
  {
    boolean bool = _parseBooleanPrimitive(paramJsonParser, paramDeserializationContext);
    if (i >= arrayOfBoolean.length)
    {
      arrayOfBoolean = (boolean[])localBooleanBuilder.appendCompletedChunk(arrayOfBoolean, i);
      i = 0;
    }
    j = i + 1;
    arrayOfBoolean[i] = bool;
  }
  return (boolean[])localBooleanBuilder.completeAndClearBuffer(arrayOfBoolean, i);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:22,代碼來源:ArrayDeserializers.java

示例4: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
@Override
public Set<Date> deserialize( final JsonParser parser, final DeserializationContext context )
  throws IOException
{
  if ( !parser.isExpectedStartArrayToken() )
  {
    throw context.mappingException( Set.class );
  }
  final HashSet<Date> result = new HashSet<Date>();

  final DateFormat formatter = DateUtil.newDateFormatter();
  JsonToken token;
  while ( JsonToken.END_ARRAY != ( token = parser.nextToken() ) )
  {
    if ( JsonToken.VALUE_NULL == token )
    {
      throw context.mappingException( Set.class );
    }
    result.add( DateUtil.parse( formatter, parser.getText() ) );
  }
  return result;
}
 
開發者ID:realityforge,項目名稱:gwt-datatypes,代碼行數:23,代碼來源:DateSetDeserializer.java

示例5: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
@Override
public List<Date> deserialize( final JsonParser parser, final DeserializationContext context )
  throws IOException
{
  if ( !parser.isExpectedStartArrayToken() )
  {
    throw context.mappingException( List.class );
  }
  final ArrayList<Date> result = new ArrayList<Date>();

  final DateFormat formatter = DateUtil.newDateFormatter();
  JsonToken token;
  while ( JsonToken.END_ARRAY != ( token = parser.nextToken() ) )
  {
    if ( JsonToken.VALUE_NULL == token )
    {
      throw context.mappingException( List.class );
    }
    result.add( DateUtil.parse( formatter, parser.getText() ) );
  }
  return result;
}
 
開發者ID:realityforge,項目名稱:gwt-datatypes,代碼行數:23,代碼來源:DateListDeserializer.java

示例6: _locateTypeId

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
protected final String _locateTypeId(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (!paramJsonParser.isExpectedStartArrayToken())
    throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.START_ARRAY, "need JSON Array to contain As.WRAPPER_ARRAY type information for class " + baseTypeName());
  if (paramJsonParser.nextToken() != JsonToken.VALUE_STRING)
    throw paramDeserializationContext.wrongTokenException(paramJsonParser, JsonToken.VALUE_STRING, "need JSON String that contains type id (for subtype of " + baseTypeName() + ")");
  String str = paramJsonParser.getText();
  paramJsonParser.nextToken();
  return str;
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:12,代碼來源:AsArrayTypeDeserializer.java

示例7: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的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

示例8: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
public ArrayNode deserialize(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext)
  throws IOException, JsonProcessingException
{
  if (paramJsonParser.isExpectedStartArrayToken())
    return deserializeArray(paramJsonParser, paramDeserializationContext);
  throw paramDeserializationContext.mappingException(ArrayNode.class);
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:8,代碼來源:JsonNodeDeserializer.java

示例9: deserialize

import org.codehaus.jackson.JsonParser; //導入方法依賴的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.JsonParser.isExpectedStartArrayToken方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。