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


Java JsonParser.clearCurrentToken方法代碼示例

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


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

示例1: BackportedJacksonMappingIterator

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
protected BackportedJacksonMappingIterator(JavaType type, JsonParser jp, DeserializationContext ctxt, JsonDeserializer<?> deser) {
    _type = type;
    _parser = jp;
    _context = ctxt;
    _deserializer = (JsonDeserializer<T>) deser;

    /* One more thing: if we are at START_ARRAY (but NOT root-level
     * one!), advance to next token (to allow matching END_ARRAY)
     */
    if (jp != null && jp.getCurrentToken() == JsonToken.START_ARRAY) {
        JsonStreamContext sc = jp.getParsingContext();
        // safest way to skip current token is to clear it (so we'll advance soon)
        if (!sc.inRoot()) {
            jp.clearCurrentToken();
        }
    }
}
 
開發者ID:xushjie1987,項目名稱:es-hadoop-v2.2.0,代碼行數:19,代碼來源:BackportedJacksonMappingIterator.java

示例2: _bind

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
protected Object _bind(JsonParser paramJsonParser)
  throws IOException, JsonParseException, JsonMappingException
{
  JsonToken localJsonToken = _initForReading(paramJsonParser);
  Object localObject;
  if ((localJsonToken == JsonToken.VALUE_NULL) || (localJsonToken == JsonToken.END_ARRAY) || (localJsonToken == JsonToken.END_OBJECT))
    localObject = this._valueToUpdate;
  while (true)
  {
    paramJsonParser.clearCurrentToken();
    return localObject;
    DeserializationContext localDeserializationContext = _createDeserializationContext(paramJsonParser, this._config);
    if (this._valueToUpdate == null)
    {
      localObject = _findRootDeserializer(this._config, this._valueType).deserialize(paramJsonParser, localDeserializationContext);
      continue;
    }
    _findRootDeserializer(this._config, this._valueType).deserialize(paramJsonParser, localDeserializationContext, this._valueToUpdate);
    localObject = this._valueToUpdate;
  }
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:22,代碼來源:ObjectReader.java

示例3: _bindAsTree

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
protected JsonNode _bindAsTree(JsonParser paramJsonParser)
  throws IOException, JsonParseException, JsonMappingException
{
  JsonToken localJsonToken = _initForReading(paramJsonParser);
  if ((localJsonToken == JsonToken.VALUE_NULL) || (localJsonToken == JsonToken.END_ARRAY) || (localJsonToken == JsonToken.END_OBJECT));
  DeserializationContext localDeserializationContext;
  for (Object localObject = NullNode.instance; ; localObject = (JsonNode)_findRootDeserializer(this._config, JSON_NODE_TYPE).deserialize(paramJsonParser, localDeserializationContext))
  {
    paramJsonParser.clearCurrentToken();
    return localObject;
    localDeserializationContext = _createDeserializationContext(paramJsonParser, this._config);
  }
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:14,代碼來源:ObjectReader.java

示例4: _readValue

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
protected Object _readValue(DeserializationConfig paramDeserializationConfig, JsonParser paramJsonParser, JavaType paramJavaType)
  throws IOException, JsonParseException, JsonMappingException
{
  JsonToken localJsonToken = _initForReading(paramJsonParser);
  if ((localJsonToken == JsonToken.VALUE_NULL) || (localJsonToken == JsonToken.END_ARRAY) || (localJsonToken == JsonToken.END_OBJECT));
  DeserializationContext localDeserializationContext;
  for (Object localObject = null; ; localObject = _findRootDeserializer(paramDeserializationConfig, paramJavaType).deserialize(paramJsonParser, localDeserializationContext))
  {
    paramJsonParser.clearCurrentToken();
    return localObject;
    localDeserializationContext = _createDeserializationContext(paramJsonParser, paramDeserializationConfig);
  }
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:14,代碼來源:ObjectMapper.java

示例5: MappingIterator

import org.codehaus.jackson.JsonParser; //導入方法依賴的package包/類
protected MappingIterator(JavaType paramJavaType, JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, JsonDeserializer<?> paramJsonDeserializer)
{
  this._type = paramJavaType;
  this._parser = paramJsonParser;
  this._context = paramDeserializationContext;
  this._deserializer = paramJsonDeserializer;
  if ((paramJsonParser != null) && (paramJsonParser.getCurrentToken() == JsonToken.START_ARRAY) && (!paramJsonParser.getParsingContext().inRoot()))
    paramJsonParser.clearCurrentToken();
}
 
開發者ID:zhangjianying,項目名稱:12306-android-Decompile,代碼行數:10,代碼來源:MappingIterator.java


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