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